()
| 271 | // Simulates a long-polling server: the request is held ~40ms, then |
| 272 | // answers with the completed result. |
| 273 | const fake: typeof fetch = async () => { |
| 274 | calls += 1; |
| 275 | inFlight += 1; |
| 276 | maxInFlight = Math.max(maxInFlight, inFlight); |
| 277 | await new Promise<void>((resolve) => setTimeout(resolve, 40)); |
| 278 | inFlight -= 1; |
| 279 | return new Response(JSON.stringify(sessionResult("s-hold"))); |
| 280 | }; |
| 281 | |
| 282 | await withFakeFetch(fake, async () => { |
| 283 | const teardown = openOAuthSystemBrowser({ |
nothing calls this directly
no test coverage detected