-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
115 lines (110 loc) · 2.71 KB
/
vitest.config.ts
File metadata and controls
115 lines (110 loc) · 2.71 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { defineConfig } from 'vitest/config';
// E2E files — must be sequential (execSync, process.cwd/argv mutation)
const e2eFiles = [
'src/cli/commands/__tests__/integration.test.ts',
'src/__tests__/integration/cli-integration.test.ts',
'src/cli/__tests__/index.test.ts',
];
// Slow files — individually slow (real subagent API calls)
const slowFiles = [
'src/integrations/claude-code/__tests__/task-coordinator.test.ts',
'src/integrations/claude-code/__tests__/agent-bridge.test.ts',
];
// Live API files — skip unless LIVE_TEST env is set
const liveFiles = [
'src/core/extensions/__tests__/openrouter-integration.test.ts',
'src/integrations/mcp/handlers/__tests__/delegate-openrouter.test.ts',
];
// Benchmark files — only run with BENCH=1
const benchmarkFiles = ['src/core/database/__tests__/search-benchmark.test.ts'];
export default defineConfig({
test: {
globals: true,
environment: 'node',
exclude: [
'node_modules',
'dist',
'.idea',
'.git',
'.cache',
'.opencode',
'external',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'**/*.test.ts',
'**/*.spec.ts',
'**/tests/**',
'**/__tests__/**',
'**/browser-test.ts',
'**/setup-*.ts',
'**/scripts/**',
],
thresholds: {
statements: 25,
branches: 20,
functions: 30,
lines: 25,
},
},
projects: [
{
extends: true,
test: {
name: 'unit',
include: ['src/**/*.{test,spec}.{ts,tsx}'],
exclude: [
...e2eFiles,
...slowFiles,
...liveFiles,
...benchmarkFiles,
'node_modules',
'dist',
],
pool: 'forks',
maxWorkers: 10,
testTimeout: 30000,
hookTimeout: 30000,
},
},
{
extends: true,
test: {
name: 'integration',
include: [...e2eFiles, ...slowFiles],
pool: 'forks',
maxWorkers: 3,
fileParallelism: false,
testTimeout: 60000,
hookTimeout: 60000,
},
},
{
extends: true,
test: {
name: 'live',
include: [...liveFiles],
pool: 'forks',
maxWorkers: 1,
testTimeout: 30000,
env: { LIVE_TEST: '1' },
},
},
{
extends: true,
test: {
name: 'bench',
include: [...benchmarkFiles],
pool: 'forks',
maxWorkers: 1,
testTimeout: 600000,
hookTimeout: 60000,
},
},
],
},
});