MCPcopy Create free account
hub / github.com/cli/cli / wait

Method wait

evals/src/suites/events/smoke-protocol.ts:139–146  ·  view source on GitHub ↗
(timeoutMs: number)

Source from the content-addressed store, hash-verified

137 }
138
139 async wait(timeoutMs: number): Promise<void> {
140 if (this.ready) return;
141 const observed = new Promise<void>(resolve => this.waiters.push(resolve));
142 const timeout = new Promise<never>((_, reject) => {
143 setTimeout(() => reject(new Error("Timed out waiting for the event stream to attach")), timeoutMs).unref();
144 });
145 await Promise.race([observed, timeout]);
146 }
147}

Callers 2

mainFunction · 0.95
smoke.test.tsFile · 0.45

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected