takt/vitest.config.ts
nrslib 9bc60c21b5 テストのメモリリークとハング問題を修正
- PieceEngineとTaskWatcherのクリーンアップ処理を追加
- vitestをシングルスレッド実行に変更してテストの安定性を向上
2026-02-04 16:27:12 +09:00

27 lines
705 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['src/__tests__/**/*.test.ts'],
environment: 'node',
globals: false,
// Ensure proper cleanup by forcing sequential execution and graceful shutdown
pool: 'threads',
poolOptions: {
threads: {
singleThread: true,
},
},
// Increase timeout for tests with async cleanup
testTimeout: 15000,
// Force exit after tests complete to prevent hanging
teardownTimeout: 5000,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.ts'],
exclude: ['src/__tests__/**', 'src/**/*.d.ts'],
},
},
});