mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:48:26 +00:00
perf(test): use setImmediate for node invoke bypass yields
This commit is contained in:
@@ -21,8 +21,8 @@ installGatewayTestHooks({ scope: "suite" });
|
|||||||
|
|
||||||
async function expectNoForwardedInvoke(hasInvoke: () => boolean): Promise<void> {
|
async function expectNoForwardedInvoke(hasInvoke: () => boolean): Promise<void> {
|
||||||
// Yield a couple of macrotasks so any accidental async forwarding would fire.
|
// Yield a couple of macrotasks so any accidental async forwarding would fire.
|
||||||
await sleep(0);
|
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||||
await sleep(0);
|
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||||
expect(hasInvoke()).toBe(false);
|
expect(hasInvoke()).toBe(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user