| 181 | export const disposeAllInstancesEffect = InstanceStore.Service.use((store) => store.disposeAll()) |
| 182 | |
| 183 | export function provideTmpdirInstance<A, E, R>( |
| 184 | self: (path: string) => Effect.Effect<A, E, R>, |
| 185 | options?: { git?: boolean; config?: Partial<ConfigV1.Info> | (() => Partial<ConfigV1.Info>) }, |
| 186 | ) { |
| 187 | return Effect.gen(function* () { |
| 188 | const path = yield* tmpdirScoped(options) |
| 189 | return yield* self(path).pipe(provideInstance(path)) |
| 190 | }).pipe(Effect.provide(testInstanceStoreLayer)) |
| 191 | } |
| 192 | |
| 193 | export class TestInstance extends Context.Service<TestInstance, { readonly directory: string }>()("@test/Instance") {} |
| 194 | |