MCPcopy
hub / github.com/ChromeDevTools/chrome-devtools-mcp / waitExecutionFor

Function waitExecutionFor

tests/utils.ts:415–430  ·  view source on GitHub ↗
(
  func: () => Promise<void>,
  timeout: number,
)

Source from the content-addressed store, hash-verified

413}
414
415export async function waitExecutionFor(
416 func: () => Promise<void>,
417 timeout: number,
418) {
419 const start = Date.now();
420 while (Date.now() - start < 10000) {
421 try {
422 await func();
423 return;
424 } catch {
425 await new Promise(resolve => setTimeout(resolve, 100)); // wait and retry
426 }
427 }
428
429 throw new Error(`Timeout of ${timeout} reached.`);
430}

Callers 1

console.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected