-
Notifications
You must be signed in to change notification settings - Fork 3
/
vitest.config.ts
30 lines (29 loc) · 940 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
import { fileURLToPath } from 'node:url';
import { mergeConfig, defineConfig } from 'vitest/config';
import viteConfig from './vite.config';
export default mergeConfig(
viteConfig,
defineConfig({
resolve: {
alias: {
vue: 'vue',
},
},
test: {
globals: true,
environment: 'happy-dom', // happy-dom provides a better performance but doesn't have a default url.
setupFiles: [fileURLToPath(new URL('./src/main/webapp/app/test-setup.ts', import.meta.url))],
reporters: ['default', 'vitest-sonar-reporter'],
outputFile: {
'vitest-sonar-reporter': fileURLToPath(new URL('./target/test-results/TESTS-results-vitest.xml', import.meta.url)),
},
coverage: {
provider: 'v8',
statements: 85,
branches: 75,
lines: 85,
reportsDirectory: fileURLToPath(new URL('./target/vite-coverage', import.meta.url)),
},
},
}),
);