-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
32 lines (31 loc) · 1.08 KB
/
vitest.config.js
File metadata and controls
32 lines (31 loc) · 1.08 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
// Use different environments based on test location
environmentMatchGlobs: [
['apps/web/**/*.test.*', 'jsdom'], // Web app tests need DOM
['apps/web/**/__tests__/**', 'jsdom'], // Web app tests need DOM
['tests/**', 'node'], // API tests use node environment
],
environment: 'node', // Default environment for API tests
setupFiles: [
'./tests/setup.js', // API test setup
'./apps/web/tests/setup.ts' // Web test setup
],
testTimeout: 30000, // 30s for database operations
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
// Skip database tests in CI environment
...(process.env.CI === 'true' ? [
'tests/security-vulnerability.test.js',
'tests/security-validation.test.js',
'tests/seed-data.test.js'
] : [])
]
}
});