Skip to content

Commit 48e900f

Browse files
committed
refactor: remove redundant tests
1 parent e2685b3 commit 48e900f

3 files changed

Lines changed: 7 additions & 114 deletions

File tree

packages/cli/mocks/configs/code-pushup.config.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

packages/cli/mocks/configs/code-pushup.config.mjs

Lines changed: 0 additions & 43 deletions
This file was deleted.

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

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,13 @@ describe('coreConfigMiddleware', () => {
2020
skipPlugins: [],
2121
};
2222

23-
it.each(['ts', 'mjs', 'js'])(
24-
'should load a valid .%s config',
25-
async extension => {
26-
const config = await coreConfigMiddleware({
27-
config: path.join(configDirPath, `code-pushup.config.${extension}`),
28-
...CLI_DEFAULTS,
29-
});
30-
expect(config.config).toContain(`code-pushup.config.${extension}`);
31-
expect(config.upload?.project).toContain(extension);
32-
},
33-
);
34-
35-
it('should throw with invalid config path', async () => {
36-
await expect(
37-
coreConfigMiddleware({ config: 'wrong/path/to/config', ...CLI_DEFAULTS }),
38-
).rejects.toThrow(/File '.*' does not exist/);
23+
it('should load a valid .%s config', async () => {
24+
const config = await coreConfigMiddleware({
25+
config: path.join(configDirPath, `code-pushup.config.ts`),
26+
...CLI_DEFAULTS,
27+
});
28+
expect(config.config).toContain(`code-pushup.config.ts`);
29+
expect(config.upload?.project).toContain('ts');
3930
});
4031

4132
it('should load config which relies on provided --tsconfig', async () => {
@@ -50,16 +41,4 @@ describe('coreConfigMiddleware', () => {
5041
}),
5142
).resolves.toBeTruthy();
5243
});
53-
54-
it('should throw if --tsconfig is missing but needed to resolve import', async () => {
55-
await expect(
56-
coreConfigMiddleware({
57-
config: path.join(
58-
configDirPath,
59-
'code-pushup.needs-tsconfig.config.ts',
60-
),
61-
...CLI_DEFAULTS,
62-
}),
63-
).rejects.toThrow("Cannot find package '@example/custom-plugin'");
64-
});
6544
});

0 commit comments

Comments
 (0)