import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config' export default defineWorkersConfig({ test: { // CRITICAL: Limit concurrency to prevent resource exhaustion maxConcurrency: 1, maxWorkers: 1, minWorkers: 1, fileParallelism: false, poolOptions: { workers: { wrangler: { configPath: './wrangler.jsonc' }, miniflare: { compatibilityDate: '2025-01-20', compatibilityFlags: ['nodejs_compat_v2'], }, }, }, include: ['src/**/*.test.ts', 'test/**/*.test.ts'], testTimeout: 60000, // AI calls can take time hookTimeout: 30000, // Coverage configuration coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], include: ['src/**/*.ts'], exclude: ['**/*.test.ts', '**/__tests__/**', '**/node_modules/**'], thresholds: { statements: 65, branches: 60, functions: 60, lines: 65, }, }, }, })