( func: () => Promise<void>, timeout: number, )
| 411 | } |
| 412 | |
| 413 | export 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…