Merge PR #3354: fix: migrate coding-agent tests to removeWithRetries (@oldschoola)

This commit is contained in:
can1357
2026-06-27 02:06:38 +02:00
203 changed files with 571 additions and 437 deletions
@@ -9,6 +9,7 @@ import { OmfgController } from "@oh-my-pi/pi-coding-agent/modes/controllers/omfg
import { initTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
import type { InteractiveModeContext } from "@oh-my-pi/pi-coding-agent/modes/types";
import { Container, type TUI } from "@oh-my-pi/pi-tui";
import { removeWithRetries } from "@oh-my-pi/pi-utils";
const PROJECT_OPTION = "This project (.omp/rules)";
const GLOBAL_OPTION = "Global — all projects (~/.omp/agent/rules)";
@@ -165,7 +166,7 @@ afterEach(async () => {
while (tempRoots.length > 0) {
const root = tempRoots.pop();
if (root) {
await fs.rm(root, { recursive: true, force: true });
await removeWithRetries(root);
}
}
});
@@ -5,6 +5,7 @@ import * as path from "node:path";
import { TodoCommandController } from "@oh-my-pi/pi-coding-agent/modes/controllers/todo-command-controller";
import type { InteractiveModeContext } from "@oh-my-pi/pi-coding-agent/modes/types";
import { type TodoPhase, USER_TODO_EDIT_CUSTOM_TYPE } from "@oh-my-pi/pi-coding-agent/tools";
import { removeWithRetries } from "@oh-my-pi/pi-utils";
function createContext(cwd: string, phases: TodoPhase[]): InteractiveModeContext {
return {
@@ -32,7 +33,7 @@ describe("TodoCommandController", () => {
let tempRoot = "";
afterEach(async () => {
if (tempRoot) await fs.rm(tempRoot, { recursive: true, force: true });
if (tempRoot) await removeWithRetries(tempRoot);
tempRoot = "";
});