mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 15:20:23 +00:00
chore: We have a sleep at home. The sleep at home:
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user