-
Notifications
You must be signed in to change notification settings - Fork 7k
Expand file tree
/
Copy pathvitest.config.mts
More file actions
55 lines (54 loc) · 1.6 KB
/
vitest.config.mts
File metadata and controls
55 lines (54 loc) · 1.6 KB
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
import { resolve } from 'path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
'@': resolve('projects/app/src'),
'@fastgpt': resolve('packages'),
'@test': resolve('test')
}
},
test: {
coverage: {
enabled: true,
reporter: ['html', 'json-summary', 'json'],
// reporter: ['text', 'text-summary', 'html', 'json-summary', 'json'],
reportOnFailure: true,
all: false, // 只包含被测试实际覆盖的文件,不包含空目录
include: ['projects/app/**/*.ts', 'packages/**/*.ts'],
exclude: [
'**/node_modules/**',
'**/*.spec.ts',
'**/*/*.d.ts',
'**/test/**',
'**/*.test.ts',
'**/*/constants.ts',
'**/*/*.const.ts',
'**/*/type.ts',
'**/*/types.ts',
'**/*/type/*',
'**/*/schema.ts',
'**/*/*.schema.ts',
'packages/global/openapi/**/*',
'packages/global/core/workflow/template/**/*'
],
cleanOnRerun: false
},
outputFile: 'test-results.json',
setupFiles: 'test/setup.ts',
globalSetup: 'test/globalSetup.ts',
// File-level execution: serial (one file at a time to avoid MongoDB conflicts)
fileParallelism: false,
// Test-level execution within a file: parallel (up to 5 concurrent tests)
maxConcurrency: 10,
pool: 'threads',
testTimeout: 20000,
hookTimeout: 30000,
reporters: ['github-actions', 'default'],
include: [
'test/**/*.test.ts',
'projects/app/test/**/*.test.ts',
'projects/marketplace/test/**/*.test.ts'
]
}
});