| 188 | } |
| 189 | |
| 190 | function setupStreamingRun({ |
| 191 | streamedOutputs = [], |
| 192 | result, |
| 193 | }: { |
| 194 | streamedOutputs?: MockBlockExecutionResult['outputs'] |
| 195 | result: MockBlockExecutionResult |
| 196 | }) { |
| 197 | mockStart.mockResolvedValue(undefined) |
| 198 | mockRunProject.mockImplementation(async (_file, options) => { |
| 199 | await options?.onBlockStart?.(TEST_BLOCK, 0, 1) |
| 200 | for (const blockOutput of streamedOutputs) { |
| 201 | await options?.onOutput?.(TEST_BLOCK.id, blockOutput) |
| 202 | } |
| 203 | await options?.onBlockDone?.(result) |
| 204 | return { totalBlocks: 1, executedBlocks: 1, failedBlocks: 0, totalDurationMs: result.durationMs } |
| 205 | }) |
| 206 | mockStop.mockResolvedValue(undefined) |
| 207 | } |
| 208 | |
| 209 | describe('run command', () => { |
| 210 | describe('runDeepnoteProject via createRunAction', () => { |