-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
67 lines (61 loc) · 1.58 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
import { defineConfig } from 'vitest/config';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const reporters = ['verbose'];
const extraReporters = !process.env.GITHUB_ACTIONS ? [] : ['github-actions', 'junit'];
const exclude = [
'**/.next/**/*.*',
'**/.turbo/**/*.*',
'**/*.d.ts',
'**/*.json',
'**/coverage/**/*.*',
'**/dist/**/*.*',
'**/instrumentation.ts',
'**/next.config.js',
'**/node_modules/**/*.*',
'**/sentry.*.config.ts',
'**/tailwind.config.js',
'**/vite.*.ts',
'**/vitest.*.ts',
'packages/db/src/**/index.ts',
'next.config.js',
'vite.config.ts',
'vitest.config.ts',
'vitest.workspace.ts'
];
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
root: resolve(__dirname),
envDir: resolve(__dirname),
optimizeDeps: {
force: true,
esbuildOptions: {
define: {
global: 'globalThis'
},
plugins: []
}
},
test: {
bail: 1,
environment: 'node',
exclude,
maxConcurrency: 16,
passWithNoTests: true,
silent: false,
reporters: [...reporters, ...extraReporters],
outputFile: {
junit: './junit.xml'
},
coverage: {
all: true,
exclude: exclude,
provider: 'v8',
reporter: ['json', 'json-summary', 'text'],
reportOnFailure: true
},
typecheck: {
tsconfig: './tsconfig.test.json'
}
}
});