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

Function createFakeTerminal

src/ink/inkRecoveryBehavior.test.tsx:82–103  ·  view source on GitHub ↗
(columns = 40, rows = 12)

Source from the content-addressed store, hash-verified

80}
81
82function createFakeTerminal(columns = 40, rows = 12): FakeTerminal {
83 let output = ''
84 let chunks: string[] = []
85 const stdout = createFakeOutput(columns, rows)
86 const stderr = createFakeOutput(columns, rows)
87 stdout.on('data', chunk => {
88 const text = chunk.toString()
89 output += text
90 chunks.push(text)
91 })
92 return {
93 stdin: createFakeInput(),
94 stdout,
95 stderr,
96 clearOutput: () => {
97 output = ''
98 chunks = []
99 },
100 getOutput: () => output,
101 getChunks: () => [...chunks],
102 }
103}
104
105async function waitFor(
106 predicate: () => boolean,

Callers 1

Calls 3

createFakeOutputFunction · 0.70
createFakeInputFunction · 0.70
toStringMethod · 0.65

Tested by

no test coverage detected