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 to current baseline (with src/pages now included). // These act as a regression ratchet to prevent coverage from dropping. // Measured at the time of change: lines 82.36%, functions 88.5%, // statements 82.36%, branches 87.7%. Deliberately not higher — pages // are now visible and poorly covered (Auth, Tips, DevFetch at 0%); // target is to raise these over time, not to churn tests today. thresholds: { lines: 80, functions: 85, branches: 85, statements: 80, }, include: ['src/**/*.{ts,tsx}'], exclude: [ 'src/main.tsx', 'src/vite-env.d.ts', 'src/types/**', '**/*.test.ts', '**/*.test.tsx', ], }, }, })