-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvitest.config.js
52 lines (51 loc) · 1.25 KB
/
vitest.config.js
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
import { fileURLToPath } from 'node:url'
import { mergeConfig, defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import viteConfig from './vite.config'
export default mergeConfig(
viteConfig,
defineConfig({
test: {
setupFiles: ['src/tests/setup-tests.js'],
environment: 'jsdom',
passWithNoTests: true,
exclude: [
...configDefaults.exclude,
'e2e/*',
'cypress',
'azion',
'.vscode',
'.husky',
'.vite',
'.github',
'docs',
'public'
],
root: fileURLToPath(new URL('./', import.meta.url)),
transformMode: {
web: [/\.[jt]sx$/]
},
coverage: {
enabled: true,
include: [
'src/services/**',
'src/views/**',
'src/helpers/**',
'src/plugins/**',
'src/modules/**'
],
statements: 91,
branches: 91,
functions: 91,
lines: 91,
reporter: ['text', 'lcov', 'html'],
reportsDirectory: './coverage/unit',
},
reporters: ['default', 'vitest-sonar-reporter'],
outputFile: {
'vitest-sonar-reporter': './coverage/unit/sonar-report.xml'
},
testTimeout: 30000
}
})
)