chore: We have a sleep at home. The sleep at home:

This commit is contained in:
cpojer
2026-02-02 21:34:47 +09:00
parent dfef943f0a
commit 6b0d6e2540
18 changed files with 69 additions and 49 deletions

View File

@@ -1,4 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { sleep } from "../utils.js";
import { runClaudeCliAgent } from "./claude-cli-runner.js";
const runCommandWithTimeoutMock = vi.fn();
@@ -22,7 +23,7 @@ async function waitForCalls(mockFn: { mock: { calls: unknown[][] } }, count: num
if (mockFn.mock.calls.length >= count) {
return;
}
await new Promise((resolve) => setTimeout(resolve, 0));
await sleep(0);
}
throw new Error(`Expected ${count} calls, got ${mockFn.mock.calls.length}`);
}