(file: string, timeout = 3_000)
| 88 | } |
| 89 | |
| 90 | async function waitForFile(file: string, timeout = 3_000) { |
| 91 | const stop = Date.now() + timeout |
| 92 | while (Date.now() < stop) { |
| 93 | if (await exists(file)) return |
| 94 | await sleep(20) |
| 95 | } |
| 96 | throw new Error(`Timed out waiting for file: ${file}`) |
| 97 | } |
| 98 | |
| 99 | // --------------------------------------------------------------------------- |
| 100 | // Test layer |
no test coverage detected