( manager: BackgroundManager, taskId: string, expected: string, )
| 114 | } |
| 115 | |
| 116 | export async function waitForOutput( |
| 117 | manager: BackgroundManager, |
| 118 | taskId: string, |
| 119 | expected: string, |
| 120 | ): Promise<void> { |
| 121 | for (let i = 0; i < 20; i++) { |
| 122 | const output = await manager.readOutput(taskId); |
| 123 | if (output.includes(expected)) return; |
| 124 | await new Promise((resolve) => setTimeout(resolve, 5)); |
| 125 | } |
| 126 | throw new Error(`Timed out waiting for output: ${expected}`); |
| 127 | } |
no test coverage detected