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

Function expectPromptInputBlock

src/testing/replScreenContractHarness.ts:194–215  ·  view source on GitHub ↗
(
  screenText: string,
  expectedLines: readonly string[],
)

Source from the content-addressed store, hash-verified

192}
193
194export function expectPromptInputBlock(
195 screenText: string,
196 expectedLines: readonly string[],
197): void {
198 const promptBand = readPromptBand(screenText, {
199 rowsBelow: Math.max(1, expectedLines.length),
200 })
201 const rows = promptBand.split('\n')
202
203 expect(rows[0], 'prompt band is missing the live prompt row').toContain('❯')
204 expect(
205 rows[0],
206 'prompt band is missing the first input line on the prompt row',
207 ).toContain(expectedLines[0] ?? '')
208
209 for (let lineIndex = 1; lineIndex < expectedLines.length; lineIndex += 1) {
210 expect(
211 rows[lineIndex] ?? '',
212 `prompt band is missing continued input line ${lineIndex + 1}`,
213 ).toContain(expectedLines[lineIndex]!)
214 }
215}
216
217export async function waitForMountedScreenText(
218 ink: MountedInkProbe | undefined,

Calls 2

readPromptBandFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected