(assertion: () => boolean)
| 232 | } |
| 233 | |
| 234 | async function waitForCondition(assertion: () => boolean) { |
| 235 | for (let attempt = 0; attempt < 50; attempt++) { |
| 236 | if (assertion()) { |
| 237 | return |
| 238 | } |
| 239 | await new Promise((resolve) => setTimeout(resolve, 0)) |
| 240 | } |
| 241 | throw new Error('Timed out waiting for condition') |
| 242 | } |
| 243 | |
| 244 | it('does not emit hook lifecycle events before devtools is mounted', () => { |
| 245 | const client = createClient({ mountDevtools: false }) |