-
-
Notifications
You must be signed in to change notification settings - Fork 811
/
Copy pathvitest.config.ts
39 lines (38 loc) · 1016 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
31
32
33
34
35
36
37
38
39
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import tsconfigPaths from 'vite-tsconfig-paths';
import svgrPlugin from 'vite-plugin-svgr';
export default defineConfig({
plugins: [
react(),
nodePolyfills({
include: ['events'],
}),
tsconfigPaths(),
svgrPlugin(),
],
test: {
include: ['src/**/*.spec.{js,jsx,ts,tsx}'],
globals: true,
environment: 'jsdom',
setupFiles: 'vitest.setup.ts',
coverage: {
enabled: true,
provider: 'istanbul',
reportsDirectory: './coverage/vitest',
exclude: [
'node_modules',
'dist',
'**/*.{spec,test}.{js,jsx,ts,tsx}',
'coverage/**',
'**/index.{js,ts}',
'**/*.d.ts',
'src/test/**',
'vitest.config.ts',
'vitest.setup.ts', // Exclude from coverage if necessary
],
reporter: ['text', 'html', 'text-summary', 'lcov'],
},
},
});