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