MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / makeTestWorkspaceHarness

Function makeTestWorkspaceHarness

packages/core/sdk/src/test-config.ts:195–217  ·  view source on GitHub ↗
(
  options?: TestConfigOptions<TPlugins>,
)

Source from the content-addressed store, hash-verified

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

Calls 3

createExecutorFunction · 0.90
makeTestConfigFunction · 0.85
closeMethod · 0.65

Tested by 4

setupMcpScopeClientFunction · 0.72
harnessFunction · 0.72
connectRejectingFunction · 0.72
inspectPluginFunction · 0.68