( assertion: () => boolean, timeoutMs = 2000, )
| 84 | } |
| 85 | |
| 86 | export async function waitFor( |
| 87 | assertion: () => boolean, |
| 88 | timeoutMs = 2000, |
| 89 | ): Promise<void> { |
| 90 | const startedAt = Date.now() |
| 91 | while (!assertion()) { |
| 92 | if (Date.now() - startedAt > timeoutMs) { |
| 93 | throw new Error(`Timed out waiting for assertion after ${timeoutMs}ms`) |
| 94 | } |
| 95 | await new Promise((resolve) => setTimeout(resolve, 10)) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | function isMissingQueryClientError(error: unknown): boolean { |
| 100 | return ( |
no outgoing calls
no test coverage detected