|
1 | 1 | import { defineConfig } from 'vitest/config'; |
2 | 2 |
|
3 | | -/** |
4 | | - * For a detailed explanation of each option, visit: |
5 | | - * https://vitest.dev/config/ |
6 | | - */ |
7 | 3 | export default defineConfig({ |
8 | 4 | test: { |
9 | | - // Vitest enables watch mode by default. We disable it here, so it can be |
10 | | - // explicitly enabled with `yarn test:watch`. |
| 5 | + // Opt in with `yarn test:watch`. |
11 | 6 | watch: false, |
12 | 7 |
|
13 | | - // The files to include in the test run. |
14 | 8 | include: ['src/**/*.test.ts'], |
15 | | - |
16 | | - // Reduce the default test timeout from 5s to 2.5s |
17 | 9 | testTimeout: 2500, |
18 | 10 |
|
19 | | - // Reset mocks between tests, so a mocked implementation cannot leak from |
20 | | - // one test into the next. |
| 11 | + // Keep mocks from leaking between tests. |
21 | 12 | mockReset: true, |
22 | 13 | restoreMocks: true, |
23 | 14 |
|
24 | 15 | passWithNoTests: true, |
25 | 16 |
|
26 | 17 | coverage: { |
27 | | - // Enabled with `--coverage`, see the `test` script. |
| 18 | + // Enabled with `--coverage` in the `test` script. |
28 | 19 | enabled: false, |
29 | 20 |
|
30 | 21 | provider: 'v8', |
31 | | - |
32 | | - // The files to include in the coverage report. |
33 | 22 | include: ['src/**/*.ts'], |
34 | | - |
35 | | - // The files to exclude from the coverage report. |
36 | 23 | exclude: ['src/**/*.test.ts'], |
37 | | - |
38 | 24 | reporter: ['text', 'html', 'json-summary'], |
39 | | - |
40 | 25 | reportsDirectory: 'coverage', |
41 | 26 |
|
42 | 27 | thresholds: { |
| 28 | + // Raises the thresholds in this file when coverage improves. |
43 | 29 | autoUpdate: true, |
44 | 30 | branches: 62.31, |
45 | 31 | functions: 62.25, |
|
0 commit comments