(language: string, producerOutput: Record<string, unknown>)
| 1182 | const REF_KEY = 'execution/workspace-1/workflow-1/execution-1/large-value-lv_ABCDEFGHIJKL.json' |
| 1183 | |
| 1184 | function createOffloadEnv(language: string, producerOutput: Record<string, unknown>) { |
| 1185 | const { block, ctx } = createResolver(language) |
| 1186 | const producer = createBlock('producer', 'Producer', BlockType.API) |
| 1187 | const state = new ExecutionState() |
| 1188 | state.setBlockOutput('producer', producerOutput) |
| 1189 | const workflow: SerializedWorkflow = { |
| 1190 | version: '1', |
| 1191 | blocks: [producer, block], |
| 1192 | connections: [], |
| 1193 | loops: {}, |
| 1194 | parallels: {}, |
| 1195 | } |
| 1196 | const resolver = new VariableResolver(workflow, {}, state) |
| 1197 | const durableCtx = { |
| 1198 | ...ctx, |
| 1199 | blockStates: state.getBlockStates(), |
| 1200 | workspaceId: 'workspace-1', |
| 1201 | workflowId: 'workflow-1', |
| 1202 | executionId: 'execution-1', |
| 1203 | largeValueKeys: [] as string[], |
| 1204 | } as ExecutionContext |
| 1205 | return { block, resolver, durableCtx } |
| 1206 | } |
| 1207 | |
| 1208 | beforeEach(() => { |
| 1209 | mockStoreLargeValue.mockReset() |
no test coverage detected