-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vitest.config.mts
57 lines (54 loc) · 1.25 KB
/
vitest.config.mts
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
import path from 'node:path';
import isCi from 'is-ci';
import { defineConfig } from 'vitest/config';
import type { CoverageReporter } from 'vitest';
const testReporters = ['default'];
const coverageReporters: CoverageReporter[] = ['text'];
if (!isCi) {
// testReporters.push('cobertura');
coverageReporters.push('html');
} else {
testReporters.push('junit');
coverageReporters.push('cobertura');
}
export default defineConfig({
test: {
globals: true,
isolate: true,
cache: {
dir: '.cache/.vitest'
},
dir: 'src',
testTimeout: 10000,
watch: false,
outputFile: 'reports/junit.xml',
reporters: testReporters,
coverage: {
include: ['src/**/*.ts', 'src/**/*.tsx'],
exclude: [
'**/__mocks__/**.*',
'**/*.d.ts',
'**/*.test.ts',
'**/*.test.tsx',
'**/*.stories.mdx',
'**/*.stories.tsx',
'test/**.*',
'src/Auth0RemixTypes.ts'
],
all: true,
reportsDirectory: './reports/coverage/unit',
reporter: coverageReporters,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
}
},
resolve: {
alias: {
'~': path.resolve(__dirname, './src')
}
}
});