2026-01-17 12:33:11 +01:00
|
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
import path from 'path'
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
feat: Audit remediation + Stripe webhook + test suites
- Apply 3 Prisma schema changes (Pending2FASession, hubApiKeyHash, SecurityVerificationCode attempts)
- Add Stripe webhook handler (checkout.session.completed -> User + Subscription + Order)
- Add stripe-service, api-key-service, rate-limit middleware
- Add security headers (CSP, HSTS, X-Frame-Options) in next.config.ts
- Harden auth routes, require ADMIN_API_KEY for orchestrator endpoints
- Add Docker auto-migration via startup.sh
- Add 7 unit test suites (api-key, dns, config-generator, automation-worker, permission, security-verification, auth-helpers)
- Fix Prisma 7 compatibility with adapter-pg mock for vitest
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 08:02:33 +01:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
// Mock @prisma/adapter-pg (Prisma 7 adapter not available locally on Node 23)
|
|
|
|
|
'@prisma/adapter-pg': path.resolve(__dirname, './src/__tests__/mocks/prisma-adapter-pg.ts'),
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-01-17 12:33:11 +01:00
|
|
|
test: {
|
|
|
|
|
environment: 'jsdom',
|
|
|
|
|
globals: true,
|
|
|
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
|
|
|
|
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
|
|
|
|
exclude: ['node_modules', '.next', 'prisma'],
|
|
|
|
|
coverage: {
|
|
|
|
|
provider: 'v8',
|
|
|
|
|
reporter: ['text', 'json', 'html'],
|
|
|
|
|
include: ['src/lib/**', 'src/hooks/**', 'src/app/api/**'],
|
|
|
|
|
exclude: [
|
|
|
|
|
'src/**/*.d.ts',
|
|
|
|
|
'src/__tests__/**',
|
|
|
|
|
'src/components/ui/**',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|