| 36 | type Runner = <A, E, R, E2>(value: Body<A, E, R | Scope.Scope>, layer: Layer.Layer<R, E2>) => Promise<A> |
| 37 | |
| 38 | const isolatedRun: Runner = (value, layer) => |
| 39 | Effect.gen(function* () { |
| 40 | const exit = yield* body(value).pipe(Effect.scoped, Effect.provide(layer), Effect.exit) |
| 41 | if (Exit.isFailure(exit)) { |
| 42 | for (const err of Cause.prettyErrors(exit.cause)) { |
| 43 | yield* Effect.logError(err) |
| 44 | } |
| 45 | } |
| 46 | return yield* exit |
| 47 | }).pipe(Effect.runPromise) |
| 48 | |
| 49 | // Builds the test layer through the shared process-wide memoMap so cached |
| 50 | // services (Bus, Session, …) match Server.Default's instances. Use for tests |