-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.integration.config.ts
More file actions
35 lines (34 loc) · 1.08 KB
/
Copy pathvitest.integration.config.ts
File metadata and controls
35 lines (34 loc) · 1.08 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
import { defineConfig } from "vitest/config";
/**
* 集成测试 vitest 配置
*
* 与单元测试 (vitest.config 默认) 隔离:
* - testTimeout 120s(单元测试默认 5s 不够 build 跑完)
* - hookTimeout 120s(fixture 复制 / install 也算 hook)
* - pool='forks' 子进程隔离,避免 watcher 文件句柄泄漏到 next test
* - maxConcurrency=2 限制并行子进程数,CI 内存友好
* - include 仅 __tests__/integration/ 下的 .test.ts
* - exclude 默认 __tests__/ 根目录的单元测试
*/
export default defineConfig({
test: {
include: ["__tests__/integration/**/*.test.ts"],
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/__tests__/integration/fixtures/**",
],
testTimeout: 120_000,
hookTimeout: 120_000,
pool: "forks",
poolOptions: {
forks: {
singleFork: false,
maxForks: 2,
minForks: 1,
},
},
maxConcurrency: 2,
reporters: ["verbose"],
},
});