| 209 | } |
| 210 | |
| 211 | export const makeTestWorkspaceHarness = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 212 | options?: TestConfigOptions<TPlugins>, |
| 213 | ) => |
| 214 | Effect.acquireRelease( |
| 215 | Effect.gen(function* () { |
| 216 | const config = makeTestConfig(options); |
| 217 | const executor = yield* createExecutor(config); |
| 218 | return { |
| 219 | config, |
| 220 | executor, |
| 221 | testDb: config.testDb, |
| 222 | tenant: String(config.tenant), |
| 223 | subject: config.subject != null ? String(config.subject) : null, |
| 224 | } as const; |
| 225 | }), |
| 226 | ({ executor, testDb }) => |
| 227 | executor |
| 228 | .close() |
| 229 | .pipe( |
| 230 | Effect.ignore, |
| 231 | Effect.andThen(Effect.promise(() => testDb.close()).pipe(Effect.ignore)), |
| 232 | ), |
| 233 | ); |
| 234 | |
| 235 | export const makeTestWorkspaceLayer = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 236 | options?: TestConfigOptions<TPlugins>, |