Skip to content

Commit 476adfa

Browse files
committed
refactor: fix tests
1 parent 51cd8c7 commit 476adfa

File tree

8 files changed

+45
-0
lines changed

8 files changed

+45
-0
lines changed

packages/ci/src/lib/monorepo/handlers/nx.unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe('nxHandler', () => {
7878
'--json',
7979
],
8080
cwd: MEMFS_VOLUME,
81+
verbose: false,
8182
} satisfies utils.ProcessConfig);
8283
});
8384

@@ -92,6 +93,7 @@ describe('nxHandler', () => {
9293
command: 'npx',
9394
args: ['nx', 'show', 'projects', '--with-target=code-pushup', '--json'],
9495
cwd: MEMFS_VOLUME,
96+
verbose: false,
9597
} satisfies utils.ProcessConfig);
9698
});
9799

packages/ci/src/lib/run.int.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,14 @@ describe('runInCI', () => {
294294
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
295295
cwd: workDir,
296296
observer: expectedObserver,
297+
verbose: false,
297298
} satisfies utils.ProcessConfig);
298299
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
299300
command: options.bin,
300301
args: [],
301302
cwd: workDir,
302303
observer: expectedObserver,
304+
verbose: false,
303305
} satisfies utils.ProcessConfig);
304306

305307
expect(logger.error).not.toHaveBeenCalled();
@@ -372,30 +374,35 @@ describe('runInCI', () => {
372374
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
373375
cwd: workDir,
374376
observer: expectedObserver,
377+
verbose: false,
375378
} satisfies utils.ProcessConfig);
376379
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
377380
command: options.bin,
378381
args: [],
379382
cwd: workDir,
380383
observer: expectedObserver,
384+
verbose: false,
381385
} satisfies utils.ProcessConfig);
382386
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
383387
command: options.bin,
384388
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
385389
cwd: workDir,
386390
observer: expectedObserver,
391+
verbose: false,
387392
} satisfies utils.ProcessConfig);
388393
expect(utils.executeProcess).toHaveBeenNthCalledWith(4, {
389394
command: options.bin,
390395
args: [],
391396
cwd: workDir,
392397
observer: expectedObserver,
398+
verbose: false,
393399
} satisfies utils.ProcessConfig);
394400
expect(utils.executeProcess).toHaveBeenNthCalledWith(5, {
395401
command: options.bin,
396402
args: ['compare'],
397403
cwd: workDir,
398404
observer: expectedObserver,
405+
verbose: false,
399406
} satisfies utils.ProcessConfig);
400407

401408
expect(logger.error).not.toHaveBeenCalled();
@@ -450,18 +457,21 @@ describe('runInCI', () => {
450457
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
451458
cwd: workDir,
452459
observer: expectedObserver,
460+
verbose: false,
453461
} satisfies utils.ProcessConfig);
454462
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
455463
command: options.bin,
456464
args: [],
457465
cwd: workDir,
458466
observer: expectedObserver,
467+
verbose: false,
459468
} satisfies utils.ProcessConfig);
460469
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
461470
command: options.bin,
462471
args: ['compare'],
463472
cwd: workDir,
464473
observer: expectedObserver,
474+
verbose: false,
465475
} satisfies utils.ProcessConfig);
466476

467477
expect(logger.error).not.toHaveBeenCalled();
@@ -521,18 +531,21 @@ describe('runInCI', () => {
521531
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
522532
cwd: workDir,
523533
observer: expectedObserver,
534+
verbose: false,
524535
} satisfies utils.ProcessConfig);
525536
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
526537
command: options.bin,
527538
args: [],
528539
cwd: workDir,
529540
observer: expectedObserver,
541+
verbose: false,
530542
} satisfies utils.ProcessConfig);
531543
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
532544
command: options.bin,
533545
args: ['compare'],
534546
cwd: workDir,
535547
observer: expectedObserver,
548+
verbose: false,
536549
} satisfies utils.ProcessConfig);
537550

538551
expect(logger.error).not.toHaveBeenCalled();
@@ -580,6 +593,7 @@ describe('runInCI', () => {
580593
args: expect.arrayContaining(['compare']),
581594
cwd: workDir,
582595
observer: expectedObserver,
596+
verbose: false,
583597
} satisfies utils.ProcessConfig);
584598
});
585599
});
@@ -714,12 +728,14 @@ describe('runInCI', () => {
714728
],
715729
cwd: expect.stringContaining(workDir),
716730
observer: expectedObserver,
731+
verbose: false,
717732
} satisfies utils.ProcessConfig);
718733
expect(utils.executeProcess).toHaveBeenCalledWith({
719734
command: runMany,
720735
args: [],
721736
cwd: expect.stringContaining(workDir),
722737
observer: expectedObserver,
738+
verbose: false,
723739
} satisfies utils.ProcessConfig);
724740

725741
expect(logger.error).not.toHaveBeenCalled();
@@ -789,6 +805,7 @@ describe('runInCI', () => {
789805
args: [],
790806
cwd: expect.stringContaining(workDir),
791807
observer: expectedObserver,
808+
verbose: false,
792809
} satisfies utils.ProcessConfig);
793810

794811
expect(logger.error).not.toHaveBeenCalled();
@@ -952,18 +969,21 @@ describe('runInCI', () => {
952969
],
953970
cwd: expect.stringContaining(workDir),
954971
observer: expectedObserver,
972+
verbose: false,
955973
} satisfies utils.ProcessConfig);
956974
expect(utils.executeProcess).toHaveBeenCalledWith({
957975
command: runMany,
958976
args: [],
959977
cwd: expect.stringContaining(workDir),
960978
observer: expectedObserver,
979+
verbose: false,
961980
} satisfies utils.ProcessConfig);
962981
expect(utils.executeProcess).toHaveBeenCalledWith({
963982
command: runMany,
964983
args: ['compare'],
965984
cwd: expect.stringContaining(workDir),
966985
observer: expectedObserver,
986+
verbose: false,
967987
} satisfies utils.ProcessConfig);
968988
expect(utils.executeProcess).toHaveBeenCalledWith({
969989
command: run,
@@ -983,6 +1003,7 @@ describe('runInCI', () => {
9831003
],
9841004
cwd: expect.stringContaining(workDir),
9851005
observer: expectedObserver,
1006+
verbose: false,
9861007
} satisfies utils.ProcessConfig);
9871008

9881009
expect(logger.error).not.toHaveBeenCalled();
@@ -1058,12 +1079,14 @@ describe('runInCI', () => {
10581079
args: [],
10591080
cwd: expect.stringContaining(workDir),
10601081
observer: expectedObserver,
1082+
verbose: false,
10611083
} satisfies utils.ProcessConfig);
10621084
expect(utils.executeProcess).toHaveBeenCalledWith({
10631085
command: runMany,
10641086
args: ['compare'],
10651087
cwd: expect.stringContaining(workDir),
10661088
observer: expectedObserver,
1089+
verbose: false,
10671090
} satisfies utils.ProcessConfig);
10681091
expect(utils.executeProcess).toHaveBeenCalledWith({
10691092
command: run,
@@ -1083,6 +1106,7 @@ describe('runInCI', () => {
10831106
],
10841107
cwd: expect.stringContaining(workDir),
10851108
observer: expectedObserver,
1109+
verbose: false,
10861110
} satisfies utils.ProcessConfig);
10871111
expect(utils.executeProcess).not.toHaveBeenCalledWith(
10881112
expect.objectContaining({
@@ -1138,18 +1162,21 @@ describe('runInCI', () => {
11381162
args: expect.any(Array),
11391163
cwd: expect.stringContaining(workDir),
11401164
observer: expectedObserver,
1165+
verbose: false,
11411166
} satisfies utils.ProcessConfig);
11421167
expect(utils.executeProcess).toHaveBeenCalledWith({
11431168
command: runMany,
11441169
args: expect.arrayContaining(['compare']),
11451170
cwd: expect.stringContaining(workDir),
11461171
observer: expectedObserver,
1172+
verbose: false,
11471173
} satisfies utils.ProcessConfig);
11481174
expect(utils.executeProcess).toHaveBeenCalledWith({
11491175
command: run,
11501176
args: expect.arrayContaining(['merge-diffs']),
11511177
cwd: expect.stringContaining(workDir),
11521178
observer: expectedObserver,
1179+
verbose: false,
11531180
} satisfies utils.ProcessConfig);
11541181
});
11551182
});
@@ -1242,12 +1269,14 @@ describe('runInCI', () => {
12421269
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
12431270
cwd: expect.stringContaining(workDir),
12441271
observer: expectedObserver,
1272+
verbose: false,
12451273
} satisfies utils.ProcessConfig);
12461274
expect(utils.executeProcess).toHaveBeenCalledWith({
12471275
command: options.bin,
12481276
args: [],
12491277
cwd: expect.stringContaining(workDir),
12501278
observer: expectedObserver,
1279+
verbose: false,
12511280
} satisfies utils.ProcessConfig);
12521281

12531282
expect(logger.error).not.toHaveBeenCalled();
@@ -1411,18 +1440,21 @@ describe('runInCI', () => {
14111440
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
14121441
cwd: expect.stringContaining(workDir),
14131442
observer: expectedObserver,
1443+
verbose: false,
14141444
} satisfies utils.ProcessConfig);
14151445
expect(utils.executeProcess).toHaveBeenCalledWith({
14161446
command: options.bin,
14171447
args: [],
14181448
cwd: expect.stringContaining(workDir),
14191449
observer: expectedObserver,
1450+
verbose: false,
14201451
} satisfies utils.ProcessConfig);
14211452
expect(utils.executeProcess).toHaveBeenCalledWith({
14221453
command: options.bin,
14231454
args: ['compare'],
14241455
cwd: expect.stringContaining(workDir),
14251456
observer: expectedObserver,
1457+
verbose: false,
14261458
} satisfies utils.ProcessConfig);
14271459
expect(utils.executeProcess).toHaveBeenCalledWith({
14281460
command: options.bin,
@@ -1442,6 +1474,7 @@ describe('runInCI', () => {
14421474
],
14431475
cwd: expect.stringContaining(workDir),
14441476
observer: expectedObserver,
1477+
verbose: false,
14451478
} satisfies utils.ProcessConfig);
14461479

14471480
expect(logger.error).not.toHaveBeenCalled();

packages/core/src/lib/implementation/runner.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe('executeRunnerConfig', () => {
7878
onStdout: expect.any(Function),
7979
onStderr: expect.any(Function),
8080
},
81+
verbose: false,
8182
});
8283
});
8384

packages/create-cli/src/lib/init.unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe('initCodePushup', () => {
6060
command: 'npx',
6161
args: ['nx', 'g', '@code-pushup/nx-plugin:init', '--skipNxJson'],
6262
observer: expect.any(Object),
63+
verbose: false,
6364
});
6465
expect(spyParseNxProcessOutput).toHaveBeenNthCalledWith(1, 'stdout-mock');
6566
expect(spyExecuteProcess).toHaveBeenNthCalledWith(2, {
@@ -71,6 +72,7 @@ describe('initCodePushup', () => {
7172
'--skipTarget',
7273
`--project="${projectJson.name}"`,
7374
],
75+
verbose: false,
7476
});
7577
expect(spyParseNxProcessOutput).toHaveBeenNthCalledWith(1, 'stdout-mock');
7678
expect(spyParseNxProcessOutput).toHaveBeenCalledTimes(2);

packages/nx-plugin/src/executors/cli/executor.int.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ describe('runAutorunExecutor', () => {
5151
onError: expect.any(Function),
5252
onStdout: expect.any(Function),
5353
},
54+
verbose: false,
5455
});
5556
});
5657
});

packages/nx-plugin/src/executors/cli/executor.unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('runAutorunExecutor', () => {
5454
onError: expect.any(Function),
5555
onStdout: expect.any(Function),
5656
},
57+
verbose: false,
5758
});
5859
});
5960

@@ -75,6 +76,7 @@ describe('runAutorunExecutor', () => {
7576
onError: expect.any(Function),
7677
onStdout: expect.any(Function),
7778
},
79+
verbose: false,
7880
});
7981
});
8082

packages/plugin-eslint/src/lib/runner/lint.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ describe('lint', () => {
112112
],
113113
ignoreExitCode: true,
114114
cwd: MEMFS_VOLUME,
115+
verbose: false,
115116
});
116117

117118
expect(eslint.calculateConfigForFile).toHaveBeenCalledTimes(3);

packages/plugin-js-packages/src/lib/package-managers/derive-yarn.unit.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe('deriveYarnVersion', () => {
2222
expect(executeProcessSpy).toHaveBeenCalledWith({
2323
command: 'yarn',
2424
args: ['-v'],
25+
verbose: false,
2526
});
2627
});
2728

@@ -33,6 +34,7 @@ describe('deriveYarnVersion', () => {
3334
expect(executeProcessSpy).toHaveBeenCalledWith({
3435
command: 'yarn',
3536
args: ['-v'],
37+
verbose: false,
3638
});
3739
});
3840

@@ -46,6 +48,7 @@ describe('deriveYarnVersion', () => {
4648
expect(executeProcessSpy).toHaveBeenCalledWith({
4749
command: 'yarn',
4850
args: ['-v'],
51+
verbose: false,
4952
});
5053
});
5154
});

0 commit comments

Comments
 (0)