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

Function waitExecutionFor

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

Source from the content-addressed store, hash-verified

533}
534
535export async function waitExecutionFor(
536 func: () => Promise<void>,
537 timeout: number,
538): Promise<void> {
539 const start = Date.now();
540 while (Date.now() - start < 10000) {
541 try {
542 await func();
543 return;
544 } catch {
545 await new Promise(resolve => setTimeout(resolve, 100)); // wait and retry
546 }
547 }
548
549 throw new Error(`Timeout of ${timeout} reached.`);
550}
551
552export function createTempDir(
553 prefix = 'chrome-devtools-test-',

Callers 3

waitForMessageFunction · 0.85
console.test.tsFile · 0.85

Calls

no outgoing calls

Tested by 1

waitForMessageFunction · 0.68