-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathvitest.config.js
More file actions
70 lines (55 loc) · 1.99 KB
/
vitest.config.js
File metadata and controls
70 lines (55 loc) · 1.99 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Test file patterns
include: ['test/**/*.test.js'],
// Exclude TypeScript typedef test (handled by tsc)
exclude: ['test/typedef.test.ts', '**/node_modules/**'],
// Enable coverage
coverage: {
// Coverage reporters: html for viewing, lcov for Coveralls, text for console
reporter: ['html', 'lcov', 'text'],
// Coverage output directory
reportsDirectory: './coverage',
// Include source files
include: ['src/**/*.js'],
// Exclude non-source files and files with v8 coverage instrumentation issues
exclude: [
'src/index.d.ts',
'src/core/inspect.js',
'src/core/util.js',
'src/_/index.js',
'**/*.test.js',
'**/node_modules/**'
]
},
// Enable watch mode support for local development
watch: false,
// Use Node.js environment (not browser)
environment: 'node',
// Globals (using explicit imports instead)
globals: false,
// Silent mode: suppress console output during tests
// Console output will only be shown for failing tests
silent: false,
// Only show console output on test failures
onConsoleLog(log, type) {
// Return false to suppress the log
// This will be overridden to show logs when tests fail
return false;
},
// Use single-threaded execution to avoid worker serialization issues
pool: 'threads',
poolOptions: {
threads: {
singleThread: true
}
},
// Disable file parallelism to avoid worker issues
fileParallelism: false,
// Limit test timeout
testTimeout: 10000,
// Limit hook timeout
hookTimeout: 10000
}
});