-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathvitest.config.mts
More file actions
43 lines (41 loc) · 1.16 KB
/
vitest.config.mts
File metadata and controls
43 lines (41 loc) · 1.16 KB
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
/// <reference types="vitest" />
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import mkcert from 'vite-plugin-mkcert';
import tsconfigPaths from 'vite-tsconfig-paths';
import { configDefaults } from 'vitest/config';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [react(), tsconfigPaths(), mkcert()],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.jsx', '.json', '.mjs', '.mts']
},
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV)
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: [path.join(__dirname, './src/tests/vitest.setup.mts')],
include: ['**/*.test.{ts,tsx}'],
exclude: [...configDefaults.exclude],
testTimeout: 30000,
clearMocks: true,
coverage: {
all: true,
include: ['src/**/*.tsx'],
provider: 'v8',
reporter: ['cobertura', 'clover', 'lcov'],
reportsDirectory: './coverage'
},
poolOptions: {
threads: {
maxThreads: 6,
minThreads: 3
}
}
}
};
});