( predicate: () => boolean, message: string, timeoutMs = 1500, )
| 105 | } |
| 106 | |
| 107 | async function waitFor( |
| 108 | predicate: () => boolean, |
| 109 | message: string, |
| 110 | timeoutMs = 1500, |
| 111 | ): Promise<void> { |
| 112 | const deadline = Date.now() + timeoutMs |
| 113 | while (Date.now() < deadline) { |
| 114 | if (predicate()) return |
| 115 | await Bun.sleep(10) |
| 116 | } |
| 117 | throw new Error(message) |
| 118 | } |
| 119 | |
| 120 | async function renderDiffDetail(props: React.ComponentProps<typeof DiffDetailView>) { |
| 121 | const terminal = createFakeTerminal() |
no test coverage detected