-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvitest.config.mts
55 lines (54 loc) · 1.33 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
import { configDefaults, defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'
import path from 'path'
export default defineConfig({
plugins: [react(), svgrPlugin()],
define: { 'process.env': {} },
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},
resolve: {
alias: {
'~': path.resolve(__dirname, 'src/'),
'~tests': path.resolve(__dirname, 'tests/'),
'~scss-components': path.resolve(
__dirname,
'src/design-system/components/'
)
}
},
test: {
environment: 'jsdom',
watch: false,
setupFiles: './tests/setup-tests.js',
globals: true,
exclude: [...configDefaults.exclude, 'packages/template/*'],
coverage: {
all: true,
reporter: ['lcov', 'text'],
include: [
'src/**/*.jsx',
'src/**/*.tsx',
'src/**/*.ts',
'src/utils/**/*.ts',
'src/utils/**/*.js',
'src/redux/**/*.ts'
],
exclude: [
'src/stories',
'./tests/setup-tests.js',
'src/**/*.styles.ts',
'src/types/**/*.ts',
'src/design-system/stories/**.tsx'
],
reportsDirectory: './tests/coverage'
},
reporters: ['vitest-sonar-reporter', 'default'],
outputFile: 'test-report.xml'
}
})