-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvitest.config.mts
38 lines (37 loc) · 1000 Bytes
/
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
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import { coverageConfigDefaults, defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: 'node',
workspace: [
{
extends: true,
test: {
environment: 'jsdom',
},
},
],
setupFiles: [
'dotenv/config',
'./src/test-config/mongodb-setup.ts',
'./src/test-config/dom-setup',
],
globals: true,
/**
* Set this to one only so that MongoDB memory server can
* run without being flaky https://github.com/shelfio/jest-mongodb/issues/366
*/
maxWorkers: process.env.CI === 'true' ? 1 : undefined,
minWorkers: process.env.CI === 'true' ? 1 : undefined,
coverage: {
exclude: [
...coverageConfigDefaults.exclude,
'**/.storybook/**',
'**/*.stories.*',
'**/storybook-static/**',
],
},
},
})