(predicate: () => boolean, timeoutMs = 5000)
| 40 | } |
| 41 | |
| 42 | async function waitFor(predicate: () => boolean, timeoutMs = 5000) { |
| 43 | const deadline = Date.now() + timeoutMs |
| 44 | while (Date.now() < deadline) { |
| 45 | if (predicate()) return |
| 46 | await new Promise((r) => setTimeout(r, 25)) |
| 47 | } |
| 48 | throw new Error('timed out waiting for condition') |
| 49 | } |
| 50 | |
| 51 | function recordedPids() { |
| 52 | try { |
no test coverage detected
searching dependent graphs…