(file: string, timeout = 3_000)
| 50 | } |
| 51 | |
| 52 | async function wait(file: string, timeout = 3_000) { |
| 53 | const stop = Date.now() + timeout |
| 54 | while (Date.now() < stop) { |
| 55 | if (await exists(file)) return |
| 56 | await sleep(20) |
| 57 | } |
| 58 | |
| 59 | throw new Error(`Timed out waiting for file: ${file}`) |
| 60 | } |
| 61 | |
| 62 | function run(msg: Msg) { |
| 63 | return new Promise<{ code: number; stdout: Buffer; stderr: Buffer }>((resolve) => { |
no test coverage detected