( predicate: () => boolean, message: string, timeoutMs = 1500, )
| 122 | } |
| 123 | |
| 124 | async function waitFor( |
| 125 | predicate: () => boolean, |
| 126 | message: string, |
| 127 | timeoutMs = 1500, |
| 128 | ): Promise<void> { |
| 129 | const deadline = Date.now() + timeoutMs |
| 130 | while (Date.now() < deadline) { |
| 131 | if (predicate()) return |
| 132 | await Bun.sleep(10) |
| 133 | } |
| 134 | throw new Error(message) |
| 135 | } |
| 136 | |
| 137 | function sgrMouse( |
| 138 | button: number, |
no test coverage detected