Skip to content

Commit 726fba9

Browse files
committed
Tweak config
1 parent 1e90ba3 commit 726fba9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

vitest.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitest/config';
1+
import { coverageConfigDefaults, defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
@@ -9,7 +9,11 @@ export default defineConfig({
99
include: ['src/**/*.test.ts'],
1010

1111
// Exclude certain files from the coverage.
12-
exclude: ['node_modules/', 'src/cli.ts', 'src/command-line-arguments.ts'],
12+
exclude: [
13+
...coverageConfigDefaults.exclude,
14+
'src/cli.ts',
15+
'src/command-line-arguments.ts',
16+
],
1317

1418
// Configure the coverage provider. We use `istanbul` here, because it
1519
// is more stable than `v8`.
@@ -36,18 +40,19 @@ export default defineConfig({
3640
// inject the globals like `describe`, `it`, `expect`, etc.
3741
globals: true,
3842

39-
// Calls .mockReset on all spies before each test.
43+
// Ensure all mock functions are reset before each test.
4044
mockReset: true,
4145

42-
// Calls .mockRestore on all spies before each test.
46+
// Ensure all mock functions are restored before each test.
4347
restoreMocks: true,
4448

45-
// Calls vi.unstubAllEnvs before each test.
49+
// Ensure environment variable stubs are removed before each test.
4650
unstubEnvs: true,
4751

48-
// Calls vi.unstubGlobals before each test.
52+
// Ensure global variable stubs are removed before each test.
4953
unstubGlobals: true,
5054

55+
// Don't watch files unless requested to do so.
5156
watch: false,
5257
},
5358
});

0 commit comments

Comments
 (0)