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

Function waitExecutionFor

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

Source from the content-addressed store, hash-verified

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

Callers 1

console.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…