(fn: () => Promise<void>)
| 74 | }) |
| 75 | |
| 76 | const captureStdout = async (fn: () => Promise<void>): Promise<string> => { |
| 77 | const stdoutSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true) |
| 78 | |
| 79 | try { |
| 80 | await fn() |
| 81 | return stdoutSpy.mock.calls.map(([chunk]) => String(chunk)).join("") |
| 82 | } finally { |
| 83 | stdoutSpy.mockRestore() |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | it("uses the CLI runtime storage path and prints JSON output", async () => { |
| 88 | vi.mocked(readWorkspaceTaskSessions).mockResolvedValue([ |