MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / run

Function run

apps/local/src/auth-tool-failures.test.ts:171–183  ·  view source on GitHub ↗
(body: (client: TestApiShape) => Effect.Effect<A, E>)

Source from the content-addressed store, hash-verified

169};
170
171const run = <A, E>(body: (client: TestApiShape) => Effect.Effect<A, E>): Effect.Effect<A, E> =>
172 Effect.gen(function* () {
173 const client = yield* HttpApiClient.make(TestApi, {
174 baseUrl: TEST_BASE_URL,
175 });
176 return yield* body(client);
177 }).pipe(
178 Effect.provide(
179 FetchHttpClient.layer.pipe(
180 Layer.provide(Layer.succeed(FetchHttpClient.Fetch)(harness.fetch)),
181 ),
182 ),
183 ) as Effect.Effect<A, E>;
184
185type EffectSuccess<T> = T extends Effect.Effect<infer A, unknown, unknown> ? A : never;
186type ExecuteResult = EffectSuccess<ReturnType<TestApiShape["executions"]["execute"]>>;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected