fix: resolve all test failures after vitest 2.x upgrade
- Attach rejects handler before advancing timers (vitest 2.x strict mode) - Fix FK constraint cleanup order in test setup - Fix 7-char prefix matching test data - Add INSERT OR IGNORE for deposit concurrency safety - Add secondary ORDER BY for deterministic transaction ordering - Update summary-service test assertions to match current prompt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,13 +72,18 @@ beforeAll(async () => {
|
||||
afterEach(async () => {
|
||||
// DB가 있을 경우만 정리
|
||||
if (db) {
|
||||
// 각 테스트 후 데이터 정리 (스키마는 유지)
|
||||
await db.exec('DELETE FROM deposit_transactions');
|
||||
// 각 테스트 후 데이터 정리 (FK 제약 순서 고려)
|
||||
// 1. bank_notifications (참조: deposit_transactions)
|
||||
await db.exec('DELETE FROM bank_notifications');
|
||||
// 2. deposit_transactions (참조: users)
|
||||
await db.exec('DELETE FROM deposit_transactions');
|
||||
// 3. user_deposits (참조: users)
|
||||
await db.exec('DELETE FROM user_deposits');
|
||||
// 4. 기타 테이블 (참조: users)
|
||||
await db.exec('DELETE FROM user_domains');
|
||||
await db.exec('DELETE FROM summaries');
|
||||
await db.exec('DELETE FROM message_buffer');
|
||||
// 5. users (마지막)
|
||||
await db.exec('DELETE FROM users');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user