-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
vitest.config.ts
58 lines (55 loc) · 1.25 KB
/
vitest.config.ts
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
55
56
57
58
/* eslint-disable import/no-default-export */
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [
{
name: 'virtual-modules',
resolveId(id) {
if (id.startsWith('cjs-') || id.startsWith('esm-')) {
return `virtual:${id}`;
}
return null;
},
},
],
resolve: {
conditions: ['node'],
},
test: {
coverage: {
exclude: [
'__fixtures__',
'src/test.ts',
// Annoying to test
'cli/src/hooks',
// Impossible to test
'common/src/helpers/requireTypedModule.ts',
'cli/src/middleware/checkNodeRequirement.ts',
'cli/src/LogWriter.tsx',
'cli/src/Wrapper.tsx',
// Not supported by Jest/Babel
'config/src/loaders/mjs.ts',
'config/src/loaders/ts.ts',
'config/src/loaders/supports',
'decorators/src/helpers/isParam.ts',
// Ignore these packages
'internal/src',
'module',
'terminal/src',
'test-utils/src',
'website/src',
],
provider: 'v8',
thresholds: {
branches: 90,
functions: 99,
lines: 99,
statements: 99,
},
},
passWithNoTests: true,
setupFiles: [path.join(path.dirname(fileURLToPath(import.meta.url)), './tests/setup.ts')],
},
});