-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
40 lines (38 loc) · 1 KB
/
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
32
33
34
35
36
37
38
39
40
import path from 'path';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'contentlayer/generated': './.contentlayer/generated',
},
},
test: {
coverage: {
enabled: Boolean(process.env.CI),
exclude: [
// Test files
'**/__buggy_tests__/**',
'**/__tests__/**',
// Storybook
'**/*.stories.{tsx,jsx}',
],
provider: 'istanbul',
reporter: ['json-summary', 'lcov', process.env.CI ? 'cobertura' : 'text'],
},
css: false,
environment: 'jsdom',
globals: true,
include: ['**/__tests__/**/(*.)(spec|test).(t|j)s?(x)'],
outputFile: {
junit: 'junit_report.xml',
},
reporters: ['default', 'junit'],
setupFiles: ['./src/tests/setup_test.ts'],
silent: Boolean(process.env.CI),
watch: !process.env.CI,
},
});