(respond: (request: Request) => Response)
| 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. |
| 189 | const 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 |
no test coverage detected