MCPcopy
hub / github.com/Effect-TS/effect / makeTestClient

Function makeTestClient

packages/platform/test/HttpClient.test.ts:339–348  ·  view source on GitHub ↗
(status: number)

Source from the content-addressed store, hash-verified

337
338 describe("retryTransient", () => {
339 const makeTestClient = (status: number) => {
340 const attemptsRef = Ref.unsafeMake(0)
341 const client = HttpClient.make((request) =>
342 Effect.gen(function*() {
343 yield* Ref.update(attemptsRef, (n) => n + 1)
344 return HttpClientResponse.fromWeb(request, new Response(null, { status }))
345 })
346 )
347 return { attemptsRef, client }
348 }
349
350 it.effect("retries 408 Request Timeout", () =>
351 Effect.gen(function*() {

Callers 1

HttpClient.test.tsFile · 0.85

Calls 2

makeMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…