(predicate: () => Promise<boolean>, timeoutMs = 10_000)
| 10 | const { copilotClient: client } = await createSdkTestContext(); |
| 11 | |
| 12 | async function waitFor(predicate: () => Promise<boolean>, timeoutMs = 10_000): Promise<void> { |
| 13 | const deadline = Date.now() + timeoutMs; |
| 14 | while (Date.now() < deadline) { |
| 15 | if (await predicate()) return; |
| 16 | await new Promise((resolve) => setTimeout(resolve, 50)); |
| 17 | } |
| 18 | throw new Error(`Condition was not met within ${timeoutMs}ms`); |
| 19 | } |
| 20 | |
| 21 | async function assertFailure( |
| 22 | action: () => Promise<unknown>, |
no test coverage detected
searching dependent graphs…