()
| 34 | // makeFakeUI's stub resolves to []; we need the inner tasks to execute so |
| 35 | // the handler reaches its JSON-output branch with real result data. |
| 36 | function makeJsonUi(): UI { |
| 37 | const ui = makeFakeUI(); |
| 38 | const withProgress = async ( |
| 39 | steps: readonly { task: () => Promise<unknown> }[], |
| 40 | ): Promise<unknown[]> => { |
| 41 | const results: unknown[] = []; |
| 42 | for (const step of steps) { |
| 43 | results.push(await step.task()); |
| 44 | } |
| 45 | return results; |
| 46 | }; |
| 47 | return { |
| 48 | ...ui, |
| 49 | mode: "json", |
| 50 | withProgress: withProgress as unknown as UI["withProgress"], |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | const noopSignals = makeNoopSignals(); |
| 55 |
no test coverage detected