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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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

Callers 15

setupMcpScopeClientFunction · 0.90
oauth-flow.test.tsFile · 0.90
connectRejectingFunction · 0.90
makeTestWorkspaceLayerFunction · 0.85
makeTestExecutorFunction · 0.85
inspectPluginFunction · 0.85

Calls 3

createExecutorFunction · 0.90
makeTestConfigFunction · 0.85
closeMethod · 0.65

Tested by 3

setupMcpScopeClientFunction · 0.72
connectRejectingFunction · 0.72
inspectPluginFunction · 0.68