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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

209}
210
211export const makeTestWorkspaceHarness = <const TPlugins extends readonly AnyPlugin[] = readonly []>(
212 options?: TestConfigOptions<TPlugins>,
213) =>
214 Effect.acquireRelease(
215 Effect.gen(function* () {
216 const config = makeTestConfig(options);
217 const executor = yield* createExecutor(config);
218 return {
219 config,
220 executor,
221 testDb: config.testDb,
222 tenant: String(config.tenant),
223 subject: config.subject != null ? String(config.subject) : null,
224 } as const;
225 }),
226 ({ executor, testDb }) =>
227 executor
228 .close()
229 .pipe(
230 Effect.ignore,
231 Effect.andThen(Effect.promise(() => testDb.close()).pipe(Effect.ignore)),
232 ),
233 );
234
235export const makeTestWorkspaceLayer = <const TPlugins extends readonly AnyPlugin[] = readonly []>(
236 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