cms.c2sgmbh/vitest.config.mts
Martin Porwoll 24ea067cd9 fix(ci): add timeouts to prevent 6-hour hangs
- Add 30-minute job-level timeouts for Tests and E2E Tests
- Add step-level timeouts: 10min unit tests, 15min integration/e2e
- Add vitest testTimeout (30s) and hookTimeout (30s)

Prevents infinite retry loops from blocking CI for hours.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 21:48:58 +00:00

39 lines
1 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
testTimeout: 30000, // 30 seconds per test
hookTimeout: 30000, // 30 seconds for beforeAll/afterAll
include: [
'tests/int/**/*.int.spec.ts',
'tests/unit/**/*.unit.spec.ts',
],
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'html', 'lcov'],
reportsDirectory: './coverage',
include: [
'src/lib/**/*.ts',
'src/hooks/**/*.ts',
'src/app/**/api/**/route.ts',
],
exclude: [
'src/**/*.d.ts',
'src/**/payload-types.ts',
'node_modules/**',
],
// Initial thresholds - increase as test coverage improves
thresholds: {
lines: 35,
functions: 50,
branches: 65,
statements: 35,
},
},
},
})