-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
31 lines (28 loc) · 1019 Bytes
/
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
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({
test: {
coverage: {
enabled: true,
all: true,
provider: 'v8',
exclude: ['**/*.js', '**/*.d.ts', '**/types/', '**/index.ts', '**/constants.ts', '**/*.test.ts', '**/*.spec.ts', '**/*.config.ts'],
reporter: ['text', 'text-summary', 'json', 'json-summary', 'html']
},
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
}
})