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

Function fake

packages/react/src/api/oauth-popup.test.ts:273–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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({

Callers

nothing calls this directly

Calls 2

sessionResultFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected