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