MCPcopy Create free account
hub / github.com/Effect-TS/effect / run

Function run

packages/ui/native/test/NativeHttpClient.test.ts:15–29  ·  view source on GitHub ↗
(
  platform: TestDevice.Platform,
  fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
  test: (client: HttpClient.HttpClient) => Effect.Effect<A, E>
)

Source from the content-addressed store, hash-verified

13const NodeFormData = FormData
14
15const run = <A, E>(
16 platform: TestDevice.Platform,
17 fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>,
18 test: (client: HttpClient.HttpClient) => Effect.Effect<A, E>
19) =>
20 Effect.runPromise(
21 Effect.gen(function*() {
22 ;(yield* TestDevice.TestDevice).setFetch(Object.assign(fetch, { preconnect: () => {} }))
23 return yield* test(yield* HttpClient.HttpClient)
24 }).pipe(
25 Effect.provide(
26 Layer.merge(NativeHttpClient.layer, TestDevice.layer(platform))
27 )
28 )
29 )
30
31describe("NativeHttpClient", () => {
32 it.each(["android", "ios"] as const)(

Callers 1

Calls 6

assignMethod · 0.80
pipeMethod · 0.65
mergeMethod · 0.65
testFunction · 0.50
provideMethod · 0.45
layerMethod · 0.45

Tested by

no test coverage detected