import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' export default defineConfig({ resolve: { alias: { '@': fileURLToPath(new URL('.', import.meta.url)), }, }, test: { environment: 'jsdom', include: ['**/*.test.{ts,tsx}'], setupFiles: ['./vitest.setup.ts'], // Default 5s flakes under pre-push load (jsdom + HeroUI transform); aborted // tests then leak async work into the next case in the same file. testTimeout: 20_000, hookTimeout: 20_000, maxWorkers: '50%', coverage: { provider: 'v8', include: ['lib/authRouting.ts', 'helpers/listResponse.ts', 'validation/auth.ts'], thresholds: { branches: 80, functions: 80, lines: 80, statements: 80, }, }, }, })