MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / withFakeFetch

Function withFakeFetch

packages/react/src/api/oauth-popup.test.ts:254–263  ·  view source on GitHub ↗
(fake: typeof fetch, run: () => Promise<void>)

Source from the content-addressed store, hash-verified

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;

Callers 1

Calls 1

runFunction · 0.50

Tested by

no test coverage detected