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

Function buildMetadataUseDraftState

apps/sim/executor/execution/executor.test.ts:392–413  ·  view source on GitHub ↗
(opts: {
    metadataUseDraftState?: boolean
    isDeployedContext?: boolean
  })

Source from the content-addressed store, hash-verified

390
391describe('DAGExecutor createExecutionContext useDraftState', () => {
392 function buildMetadataUseDraftState(opts: {
393 metadataUseDraftState?: boolean
394 isDeployedContext?: boolean
395 }): boolean | undefined {
396 const executor = new DAGExecutor({
397 workflow: { version: '1', blocks: [], connections: [] },
398 contextExtensions: {
399 workspaceId: 'ws-1',
400 isDeployedContext: opts.isDeployedContext,
401 metadata:
402 opts.metadataUseDraftState === undefined
403 ? undefined
404 : ({ useDraftState: opts.metadataUseDraftState } as ExecutionContext['metadata']),
405 },
406 })
407 const { context } = (
408 executor as unknown as {
409 createExecutionContext: (workflowId: string) => { context: ExecutionContext }
410 }
411 ).createExecutionContext('wf-1')
412 return context.metadata.useDraftState
413 }
414
415 it('honors explicit useDraftState=true even when isDeployedContext is true (table dispatcher)', () => {
416 expect(

Callers 1

executor.test.tsFile · 0.85

Calls 1

Tested by

no test coverage detected