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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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