-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvitest.config.ts
More file actions
40 lines (38 loc) · 973 Bytes
/
vitest.config.ts
File metadata and controls
40 lines (38 loc) · 973 Bytes
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
/**
* Vitest Configuration
*
* Configures the unit testing environment.
*
* Key Responsibilities:
* - Set up JSDOM environment for React component testing.
* - Configure coverage thresholds and reporters.
* - Define setup files for global test context.
*/
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
include: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'scripts/**/*.test.ts'],
exclude: ['tests/e2e/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
include: ['src/**/*.{ts,tsx}', 'scripts/**/*.{js,ts}'],
exclude: [
'src/**/*.d.ts',
'src/test/**',
'src/**/__tests__/**',
'src/main.tsx',
'src/vite-env.d.ts',
],
thresholds: {
lines: 45,
functions: 40,
branches: 35,
statements: 40,
},
},
},
})