(fake: typeof fetch, run: () => Promise<void>)
| 252 | }; |
| 253 | |
| 254 | const withFakeFetch = async (fake: typeof fetch, run: () => Promise<void>): Promise<void> => { |
| 255 | const previousFetch = globalThis.fetch; |
| 256 | globalThis.fetch = fake; |
| 257 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- test boundary: always restore the global fetch |
| 258 | try { |
| 259 | await run(); |
| 260 | } finally { |
| 261 | globalThis.fetch = previousFetch; |
| 262 | } |
| 263 | }; |
| 264 | |
| 265 | it("never stacks overlapping await requests while the server holds one open", async () => { |
| 266 | let inFlight = 0; |
no test coverage detected