Skip to content

Commit aa7df57

Browse files
committed
up
1 parent a3522cb commit aa7df57

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

.github/workflows/api-integration-gate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
5252
- name: Run integration test suite
5353
run: |
54-
npx vitest run tests/integration --reporter verbose
54+
npx vitest run --config vitest.integration.config.ts --reporter verbose
5555
5656
- name: Summary
5757
if: always()

vitest.integration.config.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)