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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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

Callers 14

setupMcpScopeClientFunction · 0.90
oauth-flow.test.tsFile · 0.90
connectRejectingFunction · 0.90
makeTestWorkspaceLayerFunction · 0.85
makeTestExecutorFunction · 0.85
inspectPluginFunction · 0.85
index.test.tsFile · 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