-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (35 loc) · 1.12 KB
/
vitest.config.ts
File metadata and controls
42 lines (35 loc) · 1.12 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
import { defineConfig } from "vitest/config"
import { cpus } from "os"
const numCpus = cpus().length
export default defineConfig({
test: {
include: ["./test/**/*.test.ts", "./src/**/*.test.ts"],
globals: true,
disableConsoleIntercept: true, // Show console.log during tests (for fixture path logging)
// Parallelization settings for maximum speed
// Use forks instead of threads - safer with native modules like node-pty
pool: "forks",
poolOptions: {
forks: {
// Use all available CPUs for parallel execution
minForks: Math.max(1, Math.floor(numCpus / 2)),
maxForks: numCpus,
// Isolate each test file for safety
isolate: true
}
},
// File-level parallelism - run all test files in parallel
fileParallelism: true,
// Run tests within each file concurrently
// Tests must be independent (each gets unique testDir, ports, etc.)
sequence: {
concurrent: true
},
// Faster test timeouts (fail fast)
testTimeout: 60000, // 60s default
hookTimeout: 30000, // 30s for hooks
coverage: {
provider: "v8"
}
}
})