-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
75 lines (62 loc) · 1.74 KB
/
Copy pathvitest.config.mjs
File metadata and controls
75 lines (62 loc) · 1.74 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
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
// Use Node.js environment for native binding compatibility
environment: 'node',
// Enable global test functions (describe, test, expect)
globals: true,
// Test file patterns
include: ['test/**/*.test.{js,ts}'],
exclude: ['node_modules', 'dist', 'build', 'deps', 'Release'],
// Timeout configurations for native binding tests
testTimeout: 30000, // 30 seconds for native operations
hookTimeout: 10000, // 10 seconds for setup/teardown
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.{js,ts}'],
exclude: [
'node_modules',
'test',
'deps',
'build',
'Release',
'dist',
'**/*.d.ts',
'**/*.test.{js,ts}',
'**/test/**'
],
// Coverage thresholds
thresholds: {
lines: 80,
functions: 80,
branches: 70,
statements: 80
}
},
// Setup files for environment configuration
setupFiles: ['test/setup.ts'],
// Enable isolation for native binding tests to prevent cross-test interference
isolate: true,
execArgv: ['--expose-gc'],
pool: 'forks',
fileParallelism: false,
maxWorkers: 1,
// Reporter configuration
reporter: ['verbose'],
// Disable file watching in CI environments
watch: false
},
// ESBuild configuration for TypeScript support
esbuild: {
target: 'es2020'
},
// Resolve configuration to support importing from src
resolve: {
alias: {
// Allow importing from src directory directly
'@': '/src'
}
},
})