import { defineConfig, configDefaults } from 'vitest/config' import react from '@vitejs/plugin-react' import path from 'path' export default defineConfig({ plugins: [react()], test: { environment: 'jsdom', globals: true, setupFiles: ['./test/setup.ts'], include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], // Exclude Playwright E2E specs + reports from the Vitest unit run. // Spread configDefaults.exclude to keep filtering node_modules/dist/build. exclude: [ 'e2e/**', 'playwright-report/**', 'test-results/**', ...configDefaults.exclude, ], coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], exclude: [ 'node_modules/', 'test/', '**/*.d.ts', '**/*.config.*', '**/mock/**', ], thresholds: { lines: 88, functions: 90, branches: 78, statements: 85, }, }, testTimeout: 30000, hookTimeout: 30000, }, resolve: { alias: { '@': path.resolve(__dirname, './'), }, }, })