MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / captureStdout

Function captureStdout

apps/cli/src/commands/cli/__tests__/list.test.ts:76–85  ·  view source on GitHub ↗
(fn: () => Promise<void>)

Source from the content-addressed store, hash-verified

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([

Callers 1

list.test.tsFile · 0.85

Calls 1

StringInterface · 0.50

Tested by

no test coverage detected