MCPcopy Create free account
hub / github.com/github/copilot-sdk / waitFor

Function waitFor

nodejs/test/e2e/copilot_request_cancel_error.e2e.test.ts:82–90  ·  view source on GitHub ↗
(predicate: () => boolean, timeoutMs: number)

Source from the content-addressed store, hash-verified

80});
81
82async function waitFor(predicate: () => boolean, timeoutMs: number): Promise<void> {
83 const deadline = Date.now() + timeoutMs;
84 while (!predicate()) {
85 if (Date.now() > deadline) {
86 throw new Error("waitFor timed out");
87 }
88 await new Promise((resolve) => setTimeout(resolve, 50));
89 }
90}
91
92/** Throws from every inference request to exercise the error-reporting path. */
93class ThrowingRequestHandler extends CopilotRequestHandler {

Calls 1

predicateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…