(onRequest: (request: Request) => void)
| 7 | /** `Fetch` is a Context.Reference defaulting to `globalThis.fetch`, so a stub |
| 8 | * layer overrides it without discharging any requirement. */ |
| 9 | const stubFetch = (onRequest: (request: Request) => void): Layer.Layer<never> => |
| 10 | Layer.succeed(FetchHttpClient.Fetch)(((input: RequestInfo | URL, init?: RequestInit) => { |
| 11 | onRequest(input instanceof Request ? input : new Request(String(input), init)); |
| 12 | return Promise.resolve(new Response(null, { status: 200 })); |
| 13 | }) as typeof globalThis.fetch); |
| 14 | |
| 15 | // The browser client exports its spans itself — no cloud span processor runs |
| 16 | // in the page — so the scrub is asserted on the serialized OTLP payload the |
no test coverage detected