-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (41 loc) · 1.28 KB
/
vitest.config.ts
File metadata and controls
53 lines (41 loc) · 1.28 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Run TypeScript directly (matches project's tsx approach)
include: ['test/**/*.test.ts'],
exclude: ['**/node_modules/**', '**/dist/**'],
// Node environment for CLI testing
environment: 'node',
// Global test APIs (describe, it, expect)
globals: true,
// Isolation prevents test pollution
isolate: true,
// Fork pool for better process isolation
pool: 'forks',
// Timeouts for E2E tests involving processes
testTimeout: 30000,
hookTimeout: 10000,
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Setup file for global configuration
setupFiles: ['./test/setup.ts'],
// Coverage configuration
coverage: {
provider: 'v8',
enabled: false, // Enable with --coverage flag
reporter: ['text', 'html', 'lcov'],
reportsDirectory: './coverage',
include: ['bin/**/*.ts'],
exclude: ['**/*.test.ts', 'test/**'],
},
// Reporter configuration
reporters: ['default'],
// Sequence configuration
sequence: {
shuffle: false, // Keep tests predictable
},
// Run E2E tests sequentially to avoid config file conflicts
fileParallelism: false,
},
});