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