Skip to content

Commit c1714fb

Browse files
committed
test: adjust middleware tests
1 parent 0aba600 commit c1714fb

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

packages/cli/src/lib/compare/compare-command.unit.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,19 @@ describe('compare-command', () => {
4141
outputDir: DEFAULT_PERSIST_OUTPUT_DIR,
4242
filename: DEFAULT_PERSIST_FILENAME,
4343
format: DEFAULT_PERSIST_FORMAT,
44+
report: true,
45+
},
46+
upload: {
47+
apiKey: 'dummy-api-key',
48+
organization: 'code-pushup',
49+
project: 'cli',
50+
server: 'https://example.com/api',
4451
},
45-
upload: expect.any(Object),
4652
},
4753
{
4854
before: 'source-report.json',
4955
after: 'target-report.json',
56+
label: undefined,
5057
},
5158
);
5259
});

packages/cli/src/lib/implementation/core-config.int.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe('parsing values from CLI and middleware', () => {
6464
filename: DEFAULT_PERSIST_FILENAME,
6565
format: DEFAULT_PERSIST_FORMAT,
6666
outputDir: DEFAULT_PERSIST_OUTPUT_DIR,
67+
report: true,
6768
});
6869
});
6970

@@ -85,6 +86,7 @@ describe('parsing values from CLI and middleware', () => {
8586
filename: 'cli-filename',
8687
format: ['md'],
8788
outputDir: 'cli-outputDir',
89+
report: true,
8890
});
8991
});
9092

@@ -101,6 +103,7 @@ describe('parsing values from CLI and middleware', () => {
101103
filename: 'rc-filename',
102104
format: ['json', 'md'],
103105
outputDir: 'rc-outputDir',
106+
report: true,
104107
});
105108
});
106109

@@ -122,6 +125,7 @@ describe('parsing values from CLI and middleware', () => {
122125
filename: 'cli-filename',
123126
format: ['md'],
124127
outputDir: 'cli-outputDir',
128+
report: true,
125129
});
126130
});
127131

@@ -141,6 +145,7 @@ describe('parsing values from CLI and middleware', () => {
141145
filename: 'rc-filename',
142146
format: DEFAULT_PERSIST_FORMAT,
143147
outputDir: 'cli-outputdir',
148+
report: true,
144149
});
145150
});
146151

packages/cli/src/lib/implementation/core-config.middleware.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export async function coreConfigMiddleware<
2323
tsconfig,
2424
persist: cliPersist,
2525
upload: cliUpload,
26-
cache: cliCache,
2726
...remainingCliOptions
2827
} = processArgs;
2928
// Search for possible configuration file extensions if path is not given
@@ -44,11 +43,6 @@ export async function coreConfigMiddleware<
4443
});
4544
return {
4645
...(config != null && { config }),
47-
cache: {
48-
write: false,
49-
read: false,
50-
...cliCache,
51-
},
5246
persist: {
5347
outputDir:
5448
cliPersist?.outputDir ??

packages/cli/src/lib/implementation/core-config.middleware.unit.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,4 @@ describe('coreConfigMiddleware', () => {
7373
'apps/website/tsconfig.json',
7474
);
7575
});
76-
77-
it('should forward normalize --persist.report option', async () => {
78-
await coreConfigMiddleware({
79-
config: 'apps/website/code-pushup.config.ts',
80-
} as GeneralCliOptions & CoreConfigCliOptions & FilterOptions);
81-
expect(readRcByPath).toHaveBeenCalledWith(
82-
'apps/website/code-pushup.config.ts',
83-
'apps/website/tsconfig.json',
84-
);
85-
});
8676
});

packages/cli/src/lib/implementation/core-config.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export type ConfigCliOptions = {
1919
verbose?: string;
2020
};
2121

22-
export type CoreConfigCliOptions = Pick<CoreConfig, 'persist' | 'cache'> & {
22+
export type CoreConfigCliOptions = Pick<CoreConfig, 'persist'> & {
2323
upload?: Partial<Omit<UploadConfig, 'timeout'>>;
2424
};

packages/cli/src/lib/merge-diffs/merge-diffs-command.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ describe('merge-diffs-command', () => {
4747
outputDir: DEFAULT_PERSIST_OUTPUT_DIR,
4848
filename: DEFAULT_PERSIST_FILENAME,
4949
format: DEFAULT_PERSIST_FORMAT,
50+
report: true,
5051
},
5152
);
5253
});

0 commit comments

Comments
 (0)