MCPcopy Index your code
hub / github.com/simstudioai/sim / createToolExecutionContext

Function createToolExecutionContext

apps/sim/tools/index.test.ts:370–384  ·  view source on GitHub ↗

* Creates a mock execution context with workspaceId for tool tests.

(overrides?: Partial<ExecutionContext>)

Source from the content-addressed store, hash-verified

368 * Creates a mock execution context with workspaceId for tool tests.
369 */
370function createToolExecutionContext(overrides?: Partial<ExecutionContext>): ExecutionContext {
371 const ctx = createExecutionContext({
372 workflowId: overrides?.workflowId ?? 'test-workflow',
373 blockStates: overrides?.blockStates,
374 executedBlocks: overrides?.executedBlocks,
375 blockLogs: overrides?.blockLogs,
376 metadata: overrides?.metadata,
377 environmentVariables: overrides?.environmentVariables,
378 })
379 return {
380 ...ctx,
381 workspaceId: 'workspace-456',
382 ...overrides,
383 } as ExecutionContext
384}
385
386/**
387 * Sets up environment variables and returns a cleanup function.

Callers 1

index.test.tsFile · 0.85

Calls 1

createExecutionContextFunction · 0.90

Tested by

no test coverage detected