(path: string, timeoutMs = 4000)
| 167 | } |
| 168 | |
| 169 | export async function waitForFile(path: string, timeoutMs = 4000): Promise<void> { |
| 170 | const deadline = Date.now() + timeoutMs |
| 171 | while (Date.now() < deadline) { |
| 172 | if (existsSync(path)) { |
| 173 | return |
| 174 | } |
| 175 | await Bun.sleep(20) |
| 176 | } |
| 177 | throw new Error(`Timed out waiting for ${path}`) |
| 178 | } |
| 179 | |
| 180 | export async function waitForText( |
| 181 | readText: () => string, |
nothing calls this directly
no test coverage detected