-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
32 lines (30 loc) · 1.12 KB
/
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
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(dirname, './src'),
},
},
test: {
environment: 'jsdom',
globals: true,
pool: 'forks', // Use forks instead of threads to avoid segmentation errors
setupFiles: ['src/__tests__/setup.ts'],
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: ['**/*.stories.*', '**/.storybook/**/*'],
typecheck: {
enabled: true, // Disable type checking during tests
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
reportsDirectory: './coverage',
include: ['src/**/*.{ts,tsx}'],
exclude: ['node_modules/', 'test/', '**/*.stories.*', '**/.storybook/**/*'],
},
},
})