| 9 | const body = <A, E, R>(value: Body<A, E, R>) => Effect.suspend(() => (typeof value === "function" ? value() : value)) |
| 10 | |
| 11 | const run = <A, E, R, E2>(value: Body<A, E, R | Scope.Scope>, layer: Layer.Layer<R, E2>) => |
| 12 | Effect.gen(function* () { |
| 13 | const exit = yield* body(value).pipe(Effect.scoped, Effect.provide(layer), Effect.exit) |
| 14 | if (Exit.isFailure(exit)) { |
| 15 | for (const err of Cause.prettyErrors(exit.cause)) { |
| 16 | yield* Effect.logError(err) |
| 17 | } |
| 18 | } |
| 19 | return yield* exit |
| 20 | }).pipe(Effect.runPromise) |
| 21 | |
| 22 | const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>) => { |
| 23 | const effect = <A, E2>(name: string, value: Body<A, E2, R | Scope.Scope>, opts?: number | TestOptions) => |