-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
50 lines (47 loc) · 1.49 KB
/
vitest.config.ts
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
import { defineConfig } from 'vitest/config'
if (process.env.TEST_WATCH) {
// Patch stdin on the process so that we can fake it to seem like a real interactive terminal and pass the TTY checks
process.stdin.isTTY = true
process.stdin.setRawMode = () => process.stdin
}
const isCI = process.env.CI === 'true'
export default defineConfig({
esbuild: {
target: 'es2022',
include: /\.(m?[jt]s|[jt]sx)$/,
exclude: []
},
test: {
coverage: {
enabled: true,
all: true,
lines: 60,
branches: 60,
functions: 60,
statements: 60,
provider: 'v8',
exclude: [
'eslint.config.js',
'esbuild.config.js',
'**/*.d.ts',
'**/*/types.ts',
'**/*/fixtures',
'**/*/expected-fixtures',
'**/*/interfaces.ts',
'./test/**/*.ts'
],
reporter: ['text', 'text-summary', 'json', 'json-summary', 'html']
},
testTimeout: 10000,
reporters: isCI ? ['verbose', 'json', 'junit'] : ['default', 'hanging-process'],
outputFile: {
json: './test-results/test-results.json',
junit: './test-results/test-results.xml'
},
benchmark: {
reporters: isCI ? ['verbose', 'json'] : 'default',
outputFile: './test-results/benchmark-results.json'
},
silent: isCI
}
})