(executeDelay = 0)
| 122 | } |
| 123 | |
| 124 | function createMockNodeOrchestrator(executeDelay = 0): MockNodeOrchestrator { |
| 125 | const mock = { |
| 126 | executionCount: 0, |
| 127 | executeNode: vi.fn().mockImplementation(async () => { |
| 128 | mock.executionCount++ |
| 129 | if (executeDelay > 0) { |
| 130 | await sleep(executeDelay) |
| 131 | } |
| 132 | return { nodeId: 'test', output: {}, isFinalOutput: false } |
| 133 | }), |
| 134 | handleNodeCompletion: vi.fn(), |
| 135 | } |
| 136 | return mock as unknown as MockNodeOrchestrator |
| 137 | } |
| 138 | |
| 139 | describe('ExecutionEngine', () => { |
| 140 | beforeEach(() => { |