Skip to content

Commit 6fd713c

Browse files
authored
Fix the major update packages including Jest. (#414)
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
1 parent 1feba4c commit 6fd713c

9 files changed

Lines changed: 3145 additions & 1693 deletions

File tree

package-lock.json

Lines changed: 3090 additions & 1636 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"minimist": "^1.2.8"
2626
},
2727
"devDependencies": {
28-
"@types/jest": "^29.5.14",
28+
"@types/jest": "^30.0.0",
2929
"@types/js-yaml": "^4.0.9",
3030
"@types/minimist": "^1.2.5",
31-
"@types/node": "^22.15.30",
31+
"@types/node": "^24.0.3",
3232
"@vercel/ncc": "^0.38.3",
33-
"jest": "^29.7.0",
33+
"jest": "^30.0.0",
3434
"prettier": "^3.5.3",
35-
"ts-jest": "^29.3.4",
35+
"ts-jest": "^29.4.0",
3636
"typescript": "5.8.3"
3737
}
3838
}

src/inputUtils.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import {parseResourceTypeInput} from './inputUtils'
2-
import {
3-
ClusterType,
4-
ResourceTypeFleet,
5-
ResourceTypeManagedCluster
6-
} from './actions/deploy'
2+
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './actions/deploy'
73

84
describe('InputUtils', () => {
95
describe('parseResourceTypeInput', () => {

src/strategyHelpers/blueGreen/promote.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('promote tests', () => {
6363

6464
await expect(
6565
promoteBlueGreenIngress(kubectl, testObjects)
66-
).rejects.toThrowError()
66+
).rejects.toThrow()
6767
})
6868

6969
test('promote blue/green service', async () => {
@@ -102,7 +102,7 @@ describe('promote tests', () => {
102102

103103
await expect(
104104
promoteBlueGreenService(kubectl, testObjects)
105-
).rejects.toThrowError()
105+
).rejects.toThrow()
106106
})
107107

108108
test('promote blue/green SMI', async () => {
@@ -153,6 +153,6 @@ describe('promote tests', () => {
153153
.spyOn(smiTester, 'validateTrafficSplitsState')
154154
.mockImplementation(() => Promise.resolve(false))
155155

156-
expect(promoteBlueGreenSMI(kubectl, testObjects)).rejects.toThrowError()
156+
expect(promoteBlueGreenSMI(kubectl, testObjects)).rejects.toThrow()
157157
})
158158
})

src/types/docker.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Docker class', () => {
1919

2020
test('pulls an image', async () => {
2121
await docker.pull(image, args)
22-
expect(actions.getExecOutput).toBeCalledWith(
22+
expect(actions.getExecOutput).toHaveBeenCalledWith(
2323
dockerPath,
2424
['pull', image, ...args],
2525
{silent: false}
@@ -28,7 +28,7 @@ describe('Docker class', () => {
2828

2929
test('pulls an image silently', async () => {
3030
await docker.pull(image, args, true)
31-
expect(actions.getExecOutput).toBeCalledWith(
31+
expect(actions.getExecOutput).toHaveBeenCalledWith(
3232
dockerPath,
3333
['pull', image, ...args],
3434
{silent: true}
@@ -38,7 +38,7 @@ describe('Docker class', () => {
3838
test('inspects a docker image', async () => {
3939
const result = await docker.inspect(image, args)
4040
expect(result).toBe(execReturn.stdout)
41-
expect(actions.getExecOutput).toBeCalledWith(
41+
expect(actions.getExecOutput).toHaveBeenCalledWith(
4242
dockerPath,
4343
['inspect', image, ...args],
4444
{silent: false}
@@ -48,7 +48,7 @@ describe('Docker class', () => {
4848
test('inspects a docker image silently', async () => {
4949
const result = await docker.inspect(image, args, true)
5050
expect(result).toBe(execReturn.stdout)
51-
expect(actions.getExecOutput).toBeCalledWith(
51+
expect(actions.getExecOutput).toHaveBeenCalledWith(
5252
dockerPath,
5353
['inspect', image, ...args],
5454
{silent: true}

src/types/kubectl.test.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Kubectl path', () => {
99
const path = 'path'
1010

1111
it('gets the kubectl path', async () => {
12-
jest.spyOn(core, 'getInput').mockImplementationOnce(() => undefined)
12+
jest.spyOn(core, 'getInput').mockImplementationOnce(() => '')
1313
jest.spyOn(io, 'which').mockImplementationOnce(async () => path)
1414

1515
expect(await getKubectlPath()).toBe(path)
@@ -24,12 +24,12 @@ describe('Kubectl path', () => {
2424

2525
it('throws if kubectl not found', async () => {
2626
// without version
27-
jest.spyOn(io, 'which').mockImplementationOnce(async () => undefined)
27+
jest.spyOn(io, 'which').mockImplementationOnce(async () => '')
2828
await expect(() => getKubectlPath()).rejects.toThrow()
2929

3030
// with verision
31-
jest.spyOn(core, 'getInput').mockImplementationOnce(() => undefined)
32-
jest.spyOn(io, 'which').mockImplementationOnce(async () => undefined)
31+
jest.spyOn(core, 'getInput').mockImplementationOnce(() => '')
32+
jest.spyOn(io, 'which').mockImplementationOnce(async () => '')
3333
await expect(() => getKubectlPath()).rejects.toThrow()
3434
})
3535
})
@@ -53,7 +53,7 @@ describe('Kubectl class', () => {
5353
const configPaths = 'configPaths'
5454
const result = await kubectl.apply(configPaths)
5555
expect(result).toBe(execReturn)
56-
expect(exec.getExecOutput).toBeCalledWith(
56+
expect(exec.getExecOutput).toHaveBeenCalledWith(
5757
kubectlPath,
5858
['apply', '-f', configPaths, '--namespace', testNamespace],
5959
{silent: false}
@@ -64,7 +64,7 @@ describe('Kubectl class', () => {
6464
const configPaths = ['configPath1', 'configPath2', 'configPath3']
6565
const result = await kubectl.apply(configPaths)
6666
expect(result).toBe(execReturn)
67-
expect(exec.getExecOutput).toBeCalledWith(
67+
expect(exec.getExecOutput).toHaveBeenCalledWith(
6868
kubectlPath,
6969
[
7070
'apply',
@@ -81,7 +81,7 @@ describe('Kubectl class', () => {
8181
const configPaths = ['configPath1', 'configPath2', 'configPath3']
8282
const result = await kubectl.apply(configPaths, true)
8383
expect(result).toBe(execReturn)
84-
expect(exec.getExecOutput).toBeCalledWith(
84+
expect(exec.getExecOutput).toHaveBeenCalledWith(
8585
kubectlPath,
8686
[
8787
'apply',
@@ -100,7 +100,7 @@ describe('Kubectl class', () => {
100100
const resourceName = 'name'
101101
const result = await kubectl.describe(resourceType, resourceName)
102102
expect(result).toBe(execReturn)
103-
expect(exec.getExecOutput).toBeCalledWith(
103+
expect(exec.getExecOutput).toHaveBeenCalledWith(
104104
kubectlPath,
105105
[
106106
'describe',
@@ -120,7 +120,7 @@ describe('Kubectl class', () => {
120120
silent,
121121
otherNamespace
122122
)
123-
expect(exec.getExecOutput).toBeCalledWith(
123+
expect(exec.getExecOutput).toHaveBeenCalledWith(
124124
kubectlPath,
125125
[
126126
'describe',
@@ -138,7 +138,7 @@ describe('Kubectl class', () => {
138138
const resourceName = 'name'
139139
const result = await kubectl.describe(resourceType, resourceName, true)
140140
expect(result).toBe(execReturn)
141-
expect(exec.getExecOutput).toBeCalledWith(
141+
expect(exec.getExecOutput).toHaveBeenCalledWith(
142142
kubectlPath,
143143
[
144144
'describe',
@@ -158,7 +158,7 @@ describe('Kubectl class', () => {
158158
silent,
159159
otherNamespace
160160
)
161-
expect(exec.getExecOutput).toBeCalledWith(
161+
expect(exec.getExecOutput).toHaveBeenCalledWith(
162162
kubectlPath,
163163
[
164164
'describe',
@@ -181,7 +181,7 @@ describe('Kubectl class', () => {
181181
annotation
182182
)
183183
expect(result).toBe(execReturn)
184-
expect(exec.getExecOutput).toBeCalledWith(
184+
expect(exec.getExecOutput).toHaveBeenCalledWith(
185185
kubectlPath,
186186
[
187187
'annotate',
@@ -202,7 +202,7 @@ describe('Kubectl class', () => {
202202
annotation,
203203
otherNamespace
204204
)
205-
expect(exec.getExecOutput).toBeCalledWith(
205+
expect(exec.getExecOutput).toHaveBeenCalledWith(
206206
kubectlPath,
207207
[
208208
'annotate',
@@ -222,7 +222,7 @@ describe('Kubectl class', () => {
222222
const annotation = 'annotation'
223223
const result = await kubectl.annotateFiles(file, annotation)
224224
expect(result).toBe(execReturn)
225-
expect(exec.getExecOutput).toBeCalledWith(
225+
expect(exec.getExecOutput).toHaveBeenCalledWith(
226226
kubectlPath,
227227
[
228228
'annotate',
@@ -238,7 +238,7 @@ describe('Kubectl class', () => {
238238

239239
// override ns
240240
await kubectl.annotateFiles(file, annotation, otherNamespace)
241-
expect(exec.getExecOutput).toBeCalledWith(
241+
expect(exec.getExecOutput).toHaveBeenCalledWith(
242242
kubectlPath,
243243
[
244244
'annotate',
@@ -258,7 +258,7 @@ describe('Kubectl class', () => {
258258
const annotation = 'annotation'
259259
const result = await kubectl.annotateFiles(files, annotation)
260260
expect(result).toBe(execReturn)
261-
expect(exec.getExecOutput).toBeCalledWith(
261+
expect(exec.getExecOutput).toHaveBeenCalledWith(
262262
kubectlPath,
263263
[
264264
'annotate',
@@ -274,7 +274,7 @@ describe('Kubectl class', () => {
274274

275275
// override ns
276276
await kubectl.annotateFiles(files, annotation, otherNamespace)
277-
expect(exec.getExecOutput).toBeCalledWith(
277+
expect(exec.getExecOutput).toHaveBeenCalledWith(
278278
kubectlPath,
279279
[
280280
'annotate',
@@ -294,7 +294,7 @@ describe('Kubectl class', () => {
294294
const labels = ['label1', 'label2']
295295
const result = await kubectl.labelFiles(file, labels)
296296
expect(result).toBe(execReturn)
297-
expect(exec.getExecOutput).toBeCalledWith(
297+
expect(exec.getExecOutput).toHaveBeenCalledWith(
298298
kubectlPath,
299299
[
300300
'label',
@@ -309,7 +309,7 @@ describe('Kubectl class', () => {
309309
)
310310

311311
await kubectl.labelFiles(file, labels, otherNamespace)
312-
expect(exec.getExecOutput).toBeCalledWith(
312+
expect(exec.getExecOutput).toHaveBeenCalledWith(
313313
kubectlPath,
314314
[
315315
'label',
@@ -329,7 +329,7 @@ describe('Kubectl class', () => {
329329
const labels = ['label1', 'label2']
330330
const result = await kubectl.labelFiles(files, labels)
331331
expect(result).toBe(execReturn)
332-
expect(exec.getExecOutput).toBeCalledWith(
332+
expect(exec.getExecOutput).toHaveBeenCalledWith(
333333
kubectlPath,
334334
[
335335
'label',
@@ -344,7 +344,7 @@ describe('Kubectl class', () => {
344344
)
345345

346346
await kubectl.labelFiles(files, labels, otherNamespace)
347-
expect(exec.getExecOutput).toBeCalledWith(
347+
expect(exec.getExecOutput).toHaveBeenCalledWith(
348348
kubectlPath,
349349
[
350350
'label',
@@ -361,7 +361,7 @@ describe('Kubectl class', () => {
361361

362362
it('gets all pods', async () => {
363363
expect(await kubectl.getAllPods()).toBe(execReturn)
364-
expect(exec.getExecOutput).toBeCalledWith(
364+
expect(exec.getExecOutput).toHaveBeenCalledWith(
365365
kubectlPath,
366366
['get', 'pods', '-o', 'json', '--namespace', testNamespace],
367367
{silent: true}
@@ -374,7 +374,7 @@ describe('Kubectl class', () => {
374374
expect(await kubectl.checkRolloutStatus(resourceType, name)).toBe(
375375
execReturn
376376
)
377-
expect(exec.getExecOutput).toBeCalledWith(
377+
expect(exec.getExecOutput).toHaveBeenCalledWith(
378378
kubectlPath,
379379
[
380380
'rollout',
@@ -388,7 +388,7 @@ describe('Kubectl class', () => {
388388

389389
// override ns
390390
await kubectl.checkRolloutStatus(resourceType, name, otherNamespace)
391-
expect(exec.getExecOutput).toBeCalledWith(
391+
expect(exec.getExecOutput).toHaveBeenCalledWith(
392392
kubectlPath,
393393
[
394394
'rollout',
@@ -405,7 +405,7 @@ describe('Kubectl class', () => {
405405
const resourceType = 'type'
406406
const name = 'name'
407407
expect(await kubectl.getResource(resourceType, name)).toBe(execReturn)
408-
expect(exec.getExecOutput).toBeCalledWith(
408+
expect(exec.getExecOutput).toHaveBeenCalledWith(
409409
kubectlPath,
410410
[
411411
'get',
@@ -421,7 +421,7 @@ describe('Kubectl class', () => {
421421
// override ns
422422
const silent = true
423423
await kubectl.getResource(resourceType, name, silent, otherNamespace)
424-
expect(exec.getExecOutput).toBeCalledWith(
424+
expect(exec.getExecOutput).toHaveBeenCalledWith(
425425
kubectlPath,
426426
[
427427
'get',
@@ -439,7 +439,7 @@ describe('Kubectl class', () => {
439439
// no args
440440
const command = 'command'
441441
expect(await kubectl.executeCommand(command)).toBe(execReturn)
442-
expect(exec.getExecOutput).toBeCalledWith(
442+
expect(exec.getExecOutput).toHaveBeenCalledWith(
443443
kubectlPath,
444444
[command, '--namespace', testNamespace],
445445
{silent: false}
@@ -448,7 +448,7 @@ describe('Kubectl class', () => {
448448
// with args
449449
const args = 'args'
450450
expect(await kubectl.executeCommand(command, args)).toBe(execReturn)
451-
expect(exec.getExecOutput).toBeCalledWith(
451+
expect(exec.getExecOutput).toHaveBeenCalledWith(
452452
kubectlPath,
453453
[command, args, '--namespace', testNamespace],
454454
{silent: false}
@@ -458,15 +458,15 @@ describe('Kubectl class', () => {
458458
it('deletes with single argument', async () => {
459459
const arg = 'argument'
460460
expect(await kubectl.delete(arg)).toBe(execReturn)
461-
expect(exec.getExecOutput).toBeCalledWith(
461+
expect(exec.getExecOutput).toHaveBeenCalledWith(
462462
kubectlPath,
463463
['delete', arg, '--namespace', testNamespace],
464464
{silent: false}
465465
)
466466

467467
// override ns
468468
await kubectl.delete(arg, otherNamespace)
469-
expect(exec.getExecOutput).toBeCalledWith(
469+
expect(exec.getExecOutput).toHaveBeenCalledWith(
470470
kubectlPath,
471471
['delete', arg, '--namespace', otherNamespace],
472472
{silent: false}
@@ -476,15 +476,15 @@ describe('Kubectl class', () => {
476476
it('deletes with multiple arguments', async () => {
477477
const args = ['argument1', 'argument2', 'argument3']
478478
expect(await kubectl.delete(args)).toBe(execReturn)
479-
expect(exec.getExecOutput).toBeCalledWith(
479+
expect(exec.getExecOutput).toHaveBeenCalledWith(
480480
kubectlPath,
481481
['delete', ...args, '--namespace', testNamespace],
482482
{silent: false}
483483
)
484484

485485
// override ns
486486
await kubectl.delete(args, otherNamespace)
487-
expect(exec.getExecOutput).toBeCalledWith(
487+
expect(exec.getExecOutput).toHaveBeenCalledWith(
488488
kubectlPath,
489489
['delete', ...args, '--namespace', otherNamespace],
490490
{silent: false}
@@ -522,15 +522,15 @@ describe('Kubectl class', () => {
522522

523523
const command = 'command'
524524
kubectl.executeCommand(command)
525-
expect(exec.getExecOutput).toBeCalledWith(
525+
expect(exec.getExecOutput).toHaveBeenCalledWith(
526526
kubectlPath,
527527
[command, '--insecure-skip-tls-verify', '--namespace', testNamespace],
528528
{silent: false}
529529
)
530530

531531
const kubectlNoFlags = new Kubectl(kubectlPath)
532532
kubectlNoFlags.executeCommand(command)
533-
expect(exec.getExecOutput).toBeCalledWith(kubectlPath, [command], {
533+
expect(exec.getExecOutput).toHaveBeenCalledWith(kubectlPath, [command], {
534534
silent: false
535535
})
536536
})

src/utilities/dockerUtils.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ describe('docker utilities', () => {
99
expect(() => checkDockerPath()).not.toThrow()
1010

1111
// docker not installed
12-
jest.spyOn(io, 'which').mockImplementationOnce(async () => undefined)
12+
jest.spyOn(io, 'which').mockImplementationOnce(async () => {
13+
throw new Error('not found')
14+
})
1315
await expect(() => checkDockerPath()).rejects.toThrow()
1416
})
1517
})

0 commit comments

Comments
 (0)