( screenText: string, expectedLines: readonly string[], )
| 192 | } |
| 193 | |
| 194 | export 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 | |
| 217 | export async function waitForMountedScreenText( |
| 218 | ink: MountedInkProbe | undefined, |
no test coverage detected