GitNexus/gitnexus/vitest.config.ts
abhigyanpatwari 1a52d05131 fix(test): use dangerouslyIgnoreUnhandledErrors instead of forceExit
forceExit killed the fork worker before local-backend.test.ts finished,
losing 12 test results. The real issue is KuzuDB's C++ destructor
segfaulting during fork process exit — all tests pass but vitest
reports the post-test crash as a failure.

dangerouslyIgnoreUnhandledErrors ignores the process-level crash
without affecting test results (98/98 tests still run and report).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:36:38 +05:30

29 lines
962 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['test/**/*.test.ts'],
testTimeout: 30000,
pool: 'forks',
singleFork: true, // run all tests in a single fork to avoid KuzuDB native cleanup crashes
globals: true,
teardownTimeout: 1000,
dangerouslyIgnoreUnhandledErrors: true, // KuzuDB native destructor segfaults on fork exit — not a test failure
coverage: {
provider: 'v8',
include: ['src/**/*.ts'],
exclude: [
'src/cli/index.ts', // CLI entry point (commander wiring)
'src/server/**', // HTTP server (requires network)
'src/core/wiki/**', // Wiki generation (requires LLM)
],
// Ratchet these up as coverage improves — CI will fail if a PR drops below
thresholds: {
statements: 25,
branches: 22,
functions: 25,
lines: 25,
},
},
},
});