(props: React.ComponentProps<typeof DiffDetailView>)
| 118 | } |
| 119 | |
| 120 | async function renderDiffDetail(props: React.ComponentProps<typeof DiffDetailView>) { |
| 121 | const terminal = createFakeTerminal() |
| 122 | liveRoot = await createRoot({ |
| 123 | stdout: terminal.stdout, |
| 124 | stdin: terminal.stdin, |
| 125 | stderr: terminal.stderr, |
| 126 | exitOnCtrlC: false, |
| 127 | patchConsole: false, |
| 128 | }) |
| 129 | liveRoot.render(<DiffDetailView {...props} />) |
| 130 | await waitFor( |
| 131 | () => terminal.getOutput().length > 0, |
| 132 | 'DiffDetailView never produced output', |
| 133 | ) |
| 134 | return terminal |
| 135 | } |
| 136 | |
| 137 | function normalizeTerminalOutput(output: string): string { |
| 138 | return stripAnsi(output).replace(/\s+/g, '').trim() |
no test coverage detected