-
Notifications
You must be signed in to change notification settings - Fork 3
/
vitest.config.mts
45 lines (42 loc) · 1.19 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
import react from '@vitejs/plugin-react-swc';
import tsConfigPaths from 'vite-tsconfig-paths';
import { configDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react(), tsConfigPaths()],
test: {
name: 'modules',
coverage: {
all: true,
include: ['src/**/*.ts?(x)'],
exclude: [
...configDefaults.exclude,
'src/**/*.stories.tsx',
'src/**/*.d.ts',
'src/tests/**/*',
'src/types/**/*',
],
provider: 'v8',
reporter: ['text', 'html', 'lcov', 'json'],
thresholds: {
statements: 90,
branches: 75,
functions: 90,
lines: 90,
},
},
environment: 'jsdom',
globals: true,
// TODO: Remove this after Storybook fixes the issue with @emotion/react
onConsoleLog(message) {
let shouldLog = true;
if (
message.includes('You are loading @emotion/react when it is already loaded.') ||
message.includes('You are using Testing Library')
) {
shouldLog = false;
}
return shouldLog;
},
setupFiles: ['@testing-library/react/dont-cleanup-after-each', './src/tests/vitest.setup.ts'],
},
});