MCPcopy Create free account
hub / github.com/Noumena-Network/code / captureWrites

Function captureWrites

src/context/promptOverlayContext.test.tsx:67–75  ·  view source on GitHub ↗
(stdout: FakeOutput)

Source from the content-addressed store, hash-verified

65}
66
67function captureWrites(stdout: FakeOutput): string[] {
68 const chunks: string[] = []
69 const write = stdout.write.bind(stdout)
70 stdout.write = ((chunk: unknown, ...args: unknown[]) => {
71 chunks.push(String(chunk))
72 return write(chunk as never, ...(args as []))
73 }) as FakeOutput['write']
74 return chunks
75}
76
77async function waitFor(
78 predicate: () => boolean,

Callers 1

Calls 1

writeFunction · 0.50

Tested by

no test coverage detected