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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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