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

Function makeTestWorkspaceHarness

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

Source from the content-addressed store, hash-verified

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

Callers 12

setupMcpScopeClientFunction · 0.90
oauth-flow.test.tsFile · 0.90
makeTestWorkspaceLayerFunction · 0.85
makeTestExecutorFunction · 0.85
inspectPluginFunction · 0.85
index.test.tsFile · 0.85
data-dir.test.tsFile · 0.85
plugin.test.tsFile · 0.85

Calls 3

createExecutorFunction · 0.90
makeTestConfigFunction · 0.85
closeMethod · 0.65

Tested by 2

setupMcpScopeClientFunction · 0.72
inspectPluginFunction · 0.68