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

Function stubFetch

apps/host-selfhost/src/telemetry.test.ts:94–98  ·  view source on GitHub ↗
(respond: (request: Request) => Response)

Source from the content-addressed store, hash-verified

92// setting it discharges no requirement — the layer is `Layer<never>` and works
93// by overriding the default in whatever context it is provided to.
94const stubFetch = (respond: (request: Request) => Response): Layer.Layer<never> =>
95 Layer.succeed(FetchHttpClient.Fetch)(((input: RequestInfo | URL, init?: RequestInit) =>
96 Promise.resolve(
97 respond(input instanceof Request ? input : new Request(String(input), init)),
98 )) as typeof globalThis.fetch);
99
100/**
101 * Runs a traced effect against a recording fetch and returns the URLs the

Callers 2

telemetry.test.tsFile · 0.85
captureExportsFunction · 0.85

Calls 2

resolveMethod · 0.80
respondFunction · 0.50

Tested by

no test coverage detected