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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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