-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvitest.config.ts
30 lines (28 loc) · 875 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 path from 'node:path'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defaultExclude, defineConfig } from 'vitest/config'
// todo msw: https://github.com/vitest-dev/vitest/blob/main/examples/react-testing-lib-msw/src/mocks/server.ts
export default defineConfig({
plugins: [react(), tsconfigPaths()],
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, './'),
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './__tests__/setup.ts',
// you might want to disable it, if you don't have tests that rely on CSS
// since parsing CSS is slow
// css: true,
coverage: {
// todo check coverage
include: ['**/*.test.ts'],
exclude: ['e2e'],
reporter: ['text', 'json', 'html'],
},
exclude: [...defaultExclude, 'e2e'],
},
})