MCPcopy Index your code
hub / github.com/github/copilot-sdk / waitFor

Function waitFor

nodejs/test/e2e/client_api.e2e.test.ts:12–19  ·  view source on GitHub ↗
(predicate: () => Promise<boolean>, timeoutMs = 10_000)

Source from the content-addressed store, hash-verified

10 const { copilotClient: client } = await createSdkTestContext();
11
12 async function waitFor(predicate: () => Promise<boolean>, timeoutMs = 10_000): Promise<void> {
13 const deadline = Date.now() + timeoutMs;
14 while (Date.now() < deadline) {
15 if (await predicate()) return;
16 await new Promise((resolve) => setTimeout(resolve, 50));
17 }
18 throw new Error(`Condition was not met within ${timeoutMs}ms`);
19 }
20
21 async function assertFailure(
22 action: () => Promise<unknown>,

Callers 1

Calls 1

predicateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…