import { defineConfig } from 'vitest/config' import react from '@vitejs/plugin-react' import { resolve } from 'path' export default defineConfig({ plugins: [react()], resolve: { alias: { '@': resolve(__dirname, 'src'), }, }, test: { globals: true, environment: 'jsdom', setupFiles: ['./tests/setup.ts'], coverage: { provider: 'v8', reporter: ['text', 'lcov'], // Thresholds set as a regression ratchet to prevent coverage from dropping. // Measured: lines 96.52%, functions 91.08%, statements 96.52%, branches 86.78%. // Set ~1-2pp below measured to catch real regressions without false positives. // Branches set conservatively (85) as it's the weakest metric. thresholds: { lines: 95, functions: 89, branches: 85, statements: 95, }, include: ['src/**/*.{ts,tsx}'], exclude: [ 'src/main.tsx', 'src/vite-env.d.ts', 'src/types/**', '**/*.test.ts', '**/*.test.tsx', ], }, }, })