(predicate, timeoutMs)
| 1322 | } |
| 1323 | |
| 1324 | async function waitUntil(predicate, timeoutMs) { |
| 1325 | const deadline = performance.now() + timeoutMs; |
| 1326 | while (performance.now() < deadline) { |
| 1327 | if (await predicate()) { |
| 1328 | return true; |
| 1329 | } |
| 1330 | await sleep(250); |
| 1331 | } |
| 1332 | return false; |
| 1333 | } |
| 1334 | |
| 1335 | function freePort() { |
| 1336 | return new Promise((resolve, reject) => { |
no test coverage detected