workorder-desk/backend/vitest.config.ts
lakshit verma 7a84996f51
test(backend): agent runtime, copilot API, and triage/worker suites with mocked provider
Also fix two bugs the tests surfaced in the merged AI implementation:
- agent-tool-call model made approval.summary/expiresAt conditionally required only when an approval subdocument is present, so blocked/error tool calls persist without a fake approval
- agent.repo.createRun coerced empty-string session/user ids to null so autonomous triage runs (no session/user) no longer fail ObjectId casting
2026-08-19 19:23:00 +05:30

26 lines
No EOL
747 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'node',
globals: false,
setupFiles: ['./tests/setup.ts'],
testTimeout: 30000,
hookTimeout: 60000,
// Test files share one database (dropDatabase per test). Run them
// sequentially so a real shared Mongo does not hit "database is being dropped".
fileParallelism: false,
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
include: ['src/**/*.ts'],
exclude: ['src/server.ts', 'src/worker.ts', 'src/scripts/**', 'src/types/**', 'src/config/logger.ts'],
thresholds: {
statements: 80,
branches: 70,
functions: 80,
lines: 80,
},
},
},
});