-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
74 lines (66 loc) · 1.66 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const reporters = ['verbose'];
const extraReporters = !!process.env.GITHUB_ACTIONS ? ['github-actions'] : [];
const exclude = [
'**/.next',
'**/.turbo',
'**/*.*css',
'**/*.d.ts',
'**/*.js*',
'**/*.mjs*',
'**/*.stories.*',
'**/coverage',
'**/dist',
'**/docs',
'**/node_modules',
'**/plop',
'**/public',
'**/src/index.ts',
'**/storybook-static',
'**/storybook',
'**/vite.*.ts',
'**/vitest.*.ts',
'**/postcss.config.*',
'tailwind.config.cjs',
'vite.config.ts',
'vitest.config.ts',
'vitest.workspace.ts',
'.prettierrc.cjs'
];
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
root: resolve(__dirname),
optimizeDeps: {
force: true,
esbuildOptions: {
define: {
global: 'globalThis'
},
plugins: []
}
},
test: {
workspace: 'vitest.workspace.ts',
bail: 2,
environment: 'happy-dom',
exclude,
maxConcurrency: 16,
passWithNoTests: true,
silent: false,
reporters: [...reporters, ...extraReporters, 'github-actions'],
pool: 'threads',
setupFiles: [`${__dirname}/vitest.setup.ts`],
coverage: {
all: true,
exclude,
provider: 'v8',
reporter: ['json', 'json-summary', 'text'],
reportOnFailure: true
},
typecheck: {
tsconfig: './tsconfig.test.json'
}
}
});