-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathvitest.config.mts
54 lines (44 loc) · 1.44 KB
/
vitest.config.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Vitest enables watch mode by default. We disable it here, so it can be
// explicitly enabled with `yarn test:watch`.
watch: false,
// The files to include in the test run.
include: ['src/**/*.test.ts'],
coverage: {
enabled: true,
// Configure the coverage provider. We use `istanbul` here, because it
// is more stable than `v8`.
provider: 'istanbul',
// The files to include in the coverage report.
include: [
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.js',
'src/**/*.jsx',
'src/**/*.mjs',
],
// The files to exclude from the coverage report. Vitest excludes test
// files by default, but not `test-d.ts` files.
exclude: ['src/**/*.test-d.ts'],
// Coverage thresholds. If the coverage is below these thresholds, the
// test will fail.
thresholds: {
// Auto-update the coverage thresholds. When this is enabled, the
// thresholds will be updated automatically when the coverage is
// above the current thresholds.
autoUpdate: true,
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
typecheck: {
enabled: true,
// The path to the tsconfig file to use for type checking.
tsconfig: './tsconfig.test.json',
},
},
});