| 191 | } |
| 192 | |
| 193 | export const makeTestWorkspaceHarness = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 194 | options?: TestConfigOptions<TPlugins>, |
| 195 | ) => |
| 196 | Effect.acquireRelease( |
| 197 | Effect.gen(function* () { |
| 198 | const config = makeTestConfig(options); |
| 199 | const executor = yield* createExecutor(config); |
| 200 | return { |
| 201 | config, |
| 202 | executor, |
| 203 | testDb: config.testDb, |
| 204 | tenant: String(config.tenant), |
| 205 | subject: config.subject != null ? String(config.subject) : null, |
| 206 | } as const; |
| 207 | }), |
| 208 | ({ executor, testDb }) => |
| 209 | executor |
| 210 | .close() |
| 211 | .pipe( |
| 212 | Effect.ignore, |
| 213 | Effect.andThen(Effect.promise(() => testDb.close()).pipe(Effect.ignore)), |
| 214 | ), |
| 215 | ); |
| 216 | |
| 217 | export const makeTestWorkspaceLayer = <const TPlugins extends readonly AnyPlugin[] = readonly []>( |
| 218 | options?: TestConfigOptions<TPlugins>, |