-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
52 lines (51 loc) · 1.36 KB
/
vitest.config.ts
File metadata and controls
52 lines (51 loc) · 1.36 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
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
env: {
// Default to development for most tests
// Security-critical tests should explicitly override NODE_ENV to 'production'
// to test production code paths (e.g., SENTRY_HASH_SALT validation, CSP enforcement)
NODE_ENV: 'development',
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
exclude: [
'node_modules/',
'.next/',
'vitest.setup.ts',
'vitest.config.ts',
'**/*.d.ts',
'**/*.config.*',
'**/types/**',
'supabase/**',
'public/**',
'scripts/**',
'**/__tests__/**',
'**/*.{test,spec}.*',
],
include: ['src/**/*.{ts,tsx}'],
// @ts-expect-error - 'all' is a valid runtime option but not in Vitest 4.x types
all: true,
thresholds: {
lines: 7,
functions: 8,
branches: 5,
statements: 7,
},
},
include: ['**/*.{test,spec}.{ts,tsx}'],
exclude: ['node_modules', '.next', 'supabase', 'e2e'],
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
})