-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
61 lines (48 loc) · 1.49 KB
/
vitest.config.ts
File metadata and controls
61 lines (48 loc) · 1.49 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Use the src directory as root for tests
root: '.',
// Include test files pattern
include: ['src/**/*.test.ts', 'src/**/*.spec.ts'],
// Exclude patterns
exclude: ['node_modules', 'dist', '.ste', '.ste-self', 'fixtures'],
// Enable globals for describe, it, expect without imports
globals: true,
// Use node environment for backend testing
environment: 'node',
// Test timeout (some integration tests may take longer)
testTimeout: 30000,
// Hook timeout for beforeAll/afterAll
hookTimeout: 30000,
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
reportsDirectory: './coverage',
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
'src/**/*.spec.ts',
'src/**/index.ts',
'node_modules/**',
],
},
// Resolve aliases for cleaner imports
alias: {
'@/': new URL('./src/', import.meta.url).pathname,
},
// Pool configuration: use 'forks' for reliable ESM mocking on Linux CI
// (threads pool can fail to apply vi.hoisted mocks to change-detector)
pool: 'forks',
poolOptions: {
forks: {
singleFork: false,
},
},
// Reporter configuration
reporters: ['default'],
// Fail fast on first error in CI
bail: process.env.CI ? 1 : 0,
},
});