-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
44 lines (35 loc) · 1011 Bytes
/
vitest.config.mjs
File metadata and controls
44 lines (35 loc) · 1011 Bytes
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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// 测试环境
environment: 'node',
// 测试文件匹配模式
include: ['test/**/*.test.js'],
// 排除目录
exclude: ['node_modules', 'dist', 'data'],
// 覆盖率配置
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
reportsDirectory: './coverage',
exclude: [
'node_modules/**',
'dist/**',
'test/**',
'src/js/**', // 前端代码需要不同的测试环境
'public/**',
'*.config.js',
],
},
// 全局设置
globals: true,
// 测试超时时间
testTimeout: 10000,
// 钩子超时时间
hookTimeout: 10000,
// 并行执行
pool: 'forks',
// 监听模式设置
watch: false,
},
});