MCPcopy Create free account
hub / github.com/EvoMap/evolver / mockFetch

Function mockFetch

test/lifecycleReauthHubUnreachable.test.js:34–42  ·  view source on GitHub ↗
(responseFactory)

Source from the content-addressed store, hash-verified

32}
33
34function mockFetch(responseFactory) {
35 const calls = [];
36 const fn = async (url, opts) => {
37 calls.push({ url, opts });
38 return responseFactory(calls.length, url);
39 };
40 fn.calls = calls;
41 return fn;
42}
43
44// A non-JSON Hub response (WAF challenge page, captive portal, gateway error)
45// has no `json()` body the API path can parse. readHubResponseText falls back

Calls

no outgoing calls

Tested by

no test coverage detected