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