MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeUrlCapturingClient

Function makeUrlCapturingClient

packages/cluster/test/HttpRunner.test.ts:12–25  ·  view source on GitHub ↗
(urlRef: Ref.Ref<Array<string>>)

Source from the content-addressed store, hash-verified

10describe("HttpRunner", () => {
11 describe("layerClientProtocolHttp", () => {
12 const makeUrlCapturingClient = (urlRef: Ref.Ref<Array<string>>) =>
13 HttpClient.make((request, url) =>
14 Ref.update(urlRef, (urls) => [...urls, url.toString()]).pipe(
15 Effect.flatMap(() =>
16 Effect.fail(
17 new HttpClientError.RequestError({
18 request,
19 reason: "Transport",
20 cause: new Error("Mock - URL captured")
21 })
22 )
23 )
24 )
25 )
26
27 const testRequest = {
28 _tag: "Request" as const,

Callers 1

HttpRunner.test.tsFile · 0.85

Calls 5

makeMethod · 0.65
pipeMethod · 0.65
updateMethod · 0.65
toStringMethod · 0.65
failMethod · 0.65

Tested by

no test coverage detected