|
| 1 | +import { defineConfig } from 'vitest/config'; |
| 2 | +import react from '@vitejs/plugin-react'; |
| 3 | +import path from 'path'; |
| 4 | + |
| 5 | +// Integration-only Vitest config: runs tests in tests/integration/** |
| 6 | +// This overrides the default config which excludes integration tests. |
| 7 | +export default defineConfig({ |
| 8 | + plugins: [react()], |
| 9 | + test: { |
| 10 | + environment: 'jsdom', |
| 11 | + globals: true, |
| 12 | + setupFiles: ['./tests/setup.ts'], |
| 13 | + // Run only lightweight per-route placeholder specs for the CI gate |
| 14 | + include: ['tests/integration/**/route.spec.ts'], |
| 15 | + exclude: ['node_modules', 'dist', '.next', 'tests/e2e/**'], |
| 16 | + pool: 'forks', |
| 17 | + poolOptions: { forks: { singleFork: true } }, |
| 18 | + hookTimeout: 30000, |
| 19 | + env: { |
| 20 | + NODE_ENV: 'test', |
| 21 | + NEXTAUTH_SECRET: 'test-secret-key-for-unit-testing-only', |
| 22 | + NEXTAUTH_URL: 'http://localhost:3000', |
| 23 | + }, |
| 24 | + coverage: { |
| 25 | + provider: 'v8', |
| 26 | + reporter: ['text', 'json', 'html', 'lcov'], |
| 27 | + include: ['src/**/*.{ts,tsx}'], |
| 28 | + exclude: [ |
| 29 | + 'src/**/*.{test,spec}.{ts,tsx}', |
| 30 | + 'src/**/__tests__/**', |
| 31 | + 'src/types/**', |
| 32 | + 'src/app/**/layout.tsx', |
| 33 | + 'src/app/**/page.tsx', |
| 34 | + ], |
| 35 | + thresholds: { |
| 36 | + lines: 80, |
| 37 | + functions: 80, |
| 38 | + branches: 80, |
| 39 | + statements: 80, |
| 40 | + }, |
| 41 | + }, |
| 42 | + }, |
| 43 | + resolve: { |
| 44 | + alias: { '@': path.resolve(__dirname, './src') }, |
| 45 | + }, |
| 46 | +}); |
0 commit comments