* Creates a test ResolutionContext with block outputs.
(
currentNodeId: string,
blockOutputs: Record<string, any> = {},
contextBlockStates?: Map<string, { output: any }>,
parallelBlockMapping?: Map<string, any>
)
| 165 | * Creates a test ResolutionContext with block outputs. |
| 166 | */ |
| 167 | function createTestContext( |
| 168 | currentNodeId: string, |
| 169 | blockOutputs: Record<string, any> = {}, |
| 170 | contextBlockStates?: Map<string, { output: any }>, |
| 171 | parallelBlockMapping?: Map<string, any> |
| 172 | ): ResolutionContext { |
| 173 | const state = new ExecutionState() |
| 174 | for (const [blockId, output] of Object.entries(blockOutputs)) { |
| 175 | state.setBlockOutput(blockId, output) |
| 176 | } |
| 177 | |
| 178 | return { |
| 179 | executionContext: { |
| 180 | workspaceId: 'workspace-1', |
| 181 | workflowId: 'workflow-1', |
| 182 | executionId: 'execution-1', |
| 183 | blockStates: contextBlockStates ?? new Map(), |
| 184 | parallelBlockMapping, |
| 185 | }, |
| 186 | executionState: state, |
| 187 | currentNodeId, |
| 188 | } as unknown as ResolutionContext |
| 189 | } |
| 190 | |
| 191 | describe('BlockResolver', () => { |
| 192 | describe('canResolve', () => { |
no test coverage detected