fix(test): migrate fs.rmSync to removeSyncWithRetries in 5 more test files
Batch migration of 13 fs.rmSync calls to removeSyncWithRetries across: - core/apply-patch.test.ts (4 calls) - bash-executor.test.ts (4 calls) - tools.test.ts (2 calls) - compaction-hooks.test.ts (1 call) - compaction-thinking-model.test.ts (2 calls) Also exports removeSyncWithRetries from @oh-my-pi/pi-utils as a standalone function for tests that manage their own temp dirs. All tests pass: 139 pass, 0 fail across the 5 migrated files.
This commit is contained in:
@@ -12,7 +12,7 @@ import { afterEach, beforeEach, describe } from "bun:test";
|
||||
import * as fs from "node:fs";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { Snowflake } from "@oh-my-pi/pi-utils";
|
||||
import { removeSyncWithRetries, Snowflake } from "@oh-my-pi/pi-utils";
|
||||
import { e2eApiKey } from "./utilities";
|
||||
|
||||
// Check for auth
|
||||
@@ -36,7 +36,7 @@ describe.skipIf(!HAS_ANTIGRAVITY_AUTH)("Compaction with thinking models (Antigra
|
||||
authStorage?.close();
|
||||
authStorage = undefined;
|
||||
if (tempDir && fs.existsSync(tempDir)) {
|
||||
fs.rmSync(tempDir, { recursive: true });
|
||||
removeSyncWithRetries(tempDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -61,7 +61,7 @@ describe.skipIf(!HAS_ANTHROPIC_AUTH)("Compaction with thinking models (Anthropic
|
||||
authStorage?.close();
|
||||
authStorage = undefined;
|
||||
if (tempDir && fs.existsSync(tempDir)) {
|
||||
fs.rmSync(tempDir, { recursive: true });
|
||||
removeSyncWithRetries(tempDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user