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

Function stubFetch

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

Source from the content-addressed store, hash-verified

187// setting it discharges no requirement — the layer is `Layer<never>` and works
188// by overriding the default in whatever context it is provided to.
189const stubFetch = (respond: (request: Request) => Response): Layer.Layer<never> =>
190 Layer.succeed(FetchHttpClient.Fetch)(((input: RequestInfo | URL, init?: RequestInit) =>
191 Promise.resolve(
192 respond(input instanceof Request ? input : new Request(String(input), init)),
193 )) as typeof globalThis.fetch);
194
195/**
196 * Runs a traced effect against a recording fetch and returns the URLs the

Callers 2

telemetry.test.tsFile · 0.70
captureExportsFunction · 0.70

Calls 2

resolveMethod · 0.80
respondFunction · 0.50

Tested by

no test coverage detected