(assertion, timeoutMs = 3000)
| 42 | } |
| 43 | |
| 44 | async function waitFor(assertion, timeoutMs = 3000) { |
| 45 | const startedAt = Date.now() |
| 46 | while (!assertion()) { |
| 47 | if (Date.now() - startedAt > timeoutMs) { |
| 48 | throw new Error(`Timed out waiting for assertion after ${timeoutMs}ms`) |
| 49 | } |
| 50 | await new Promise((resolve) => setTimeout(resolve, 5)) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | async function run(cycles = 1000) { |
| 55 | const client = new QueryClient({ |
no outgoing calls
no test coverage detected