Files
fission-ai__openspec/vitest.config.ts
Tabish Bidiwale c51ba91bb6 fix(test): prevent hanging vitest threads after test runs
- Add teardownTimeout (3s) to vitest config for forced cleanup
- Add global teardown function to vitest.setup.ts
- Call child.unref() to prevent child processes from blocking event loop
- Explicitly destroy stdio streams on process close/error
2025-12-25 03:25:46 +11:00

27 lines
613 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
globalSetup: './vitest.setup.ts',
// Keep default pool settings; some tests rely on process.chdir,
// which is not supported in worker threads
include: ['test/**/*.test.ts'],
coverage: {
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'bin/',
'*.config.ts',
'build.js',
'test/**'
]
},
testTimeout: 10000,
hookTimeout: 10000,
teardownTimeout: 3000
}
});