-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.js
More file actions
35 lines (29 loc) · 872 Bytes
/
vitest.config.js
File metadata and controls
35 lines (29 loc) · 872 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
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [react()],
test: {
// Use jsdom environment for browser APIs
environment: 'jsdom',
// Global test setup file
setupFiles: ['./tests/setup.js'],
// Include patterns
include: ['tests/**/*.test.{js,jsx}'],
// Globals (allows using expect, describe, it without importing)
globals: true,
// Test timeout for long-running integration tests with production APIs
// Phase 3: Increased to 60s for real openpv.de API calls
testTimeout: 60000,
// Retry failed tests (helps with flaky API-dependent tests)
retry: 1,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
define: {
'process.env.PUBLIC_URL': JSON.stringify(''),
},
})