Skip to content

Commit cfe1faa

Browse files
committed
test(cli): fix middleware options passed in tests
1 parent 24744f3 commit cfe1faa

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ const configDirPath = join(
1919
);
2020

2121
describe('coreConfigMiddleware', () => {
22+
const CLI_DEFAULTS = {
23+
progress: true,
24+
verbose: false,
25+
onlyPlugins: [],
26+
};
27+
2228
it.each(['ts', 'mjs', 'js'])(
2329
'should load a valid .%s config',
2430
async extension => {
2531
const config = await coreConfigMiddleware({
2632
config: join(configDirPath, `code-pushup.config.${extension}`),
33+
...CLI_DEFAULTS,
2734
});
2835
expect(config.config).toContain(`code-pushup.config.${extension}`);
2936
expect(config.upload?.project).toContain(extension);
@@ -32,7 +39,7 @@ describe('coreConfigMiddleware', () => {
3239

3340
it('should throw with invalid config path', async () => {
3441
await expect(
35-
coreConfigMiddleware({ config: 'wrong/path/to/config' }),
42+
coreConfigMiddleware({ config: 'wrong/path/to/config', ...CLI_DEFAULTS }),
3643
).rejects.toThrow(/Provided path .* is not valid./);
3744
});
3845

@@ -41,6 +48,7 @@ describe('coreConfigMiddleware', () => {
4148
coreConfigMiddleware({
4249
config: join(configDirPath, 'code-pushup.needs-tsconfig.config.ts'),
4350
tsconfig: 'tsconfig.base.json',
51+
...CLI_DEFAULTS,
4452
}),
4553
).resolves.toBeTruthy();
4654
});
@@ -49,6 +57,7 @@ describe('coreConfigMiddleware', () => {
4957
await expect(
5058
coreConfigMiddleware({
5159
config: join(configDirPath, 'code-pushup.needs-tsconfig.config.ts'),
60+
...CLI_DEFAULTS,
5261
}),
5362
).rejects.toThrow("Cannot find package '@code-pushup/models'");
5463
});

0 commit comments

Comments
 (0)