Skip to content

Commit 172e748

Browse files
committed
fix coverage check config
1 parent df87a11 commit 172e748

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

vitest.coverage-check.config.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { defineConfig } from 'vitest/config';
2-
import base from './vitest.config';
1+
import { defineConfig, mergeConfig } from 'vitest/config';
2+
import baseConfig from './vitest.config';
33

44
// CI/quality gate: enforce minimum coverage thresholds (global).
5-
export default defineConfig({
6-
...(base as unknown as Record<string, unknown>),
7-
test: {
8-
// @ts-expect-error - base config shape is compatible at runtime
9-
...(base.test ?? {}),
10-
coverage: {
11-
// @ts-expect-error - base config shape is compatible at runtime
12-
...(base.test?.coverage ?? {}),
13-
thresholds: {
14-
lines: 20,
15-
functions: 20,
16-
branches: 20,
17-
statements: 20,
5+
export default mergeConfig(
6+
baseConfig,
7+
defineConfig({
8+
test: {
9+
coverage: {
10+
// Re-declare provider to keep types narrow.
11+
provider: 'v8',
12+
thresholds: {
13+
lines: 20,
14+
functions: 20,
15+
branches: 20,
16+
statements: 20,
17+
},
1818
},
1919
},
20-
},
21-
});
20+
})
21+
);
2222

0 commit comments

Comments
 (0)