| 91 | } |
| 92 | |
| 93 | function makeLog(overrides: Partial<WorkflowExecutionLog> = {}): WorkflowExecutionLog { |
| 94 | return { |
| 95 | id: 'log-1', |
| 96 | workflowId: 'wf-source', |
| 97 | executionId: 'exec-1', |
| 98 | stateSnapshotId: 'snap-1', |
| 99 | level: 'error', |
| 100 | trigger: 'manual', |
| 101 | startedAt: '2026-06-09T00:00:00.000Z', |
| 102 | endedAt: '2026-06-09T00:00:01.000Z', |
| 103 | totalDurationMs: 1000, |
| 104 | executionData: { |
| 105 | error: 'boom', |
| 106 | finalOutput: { result: 42 }, |
| 107 | } as WorkflowExecutionLog['executionData'], |
| 108 | cost: { total: 0.25 } as WorkflowExecutionLog['cost'], |
| 109 | createdAt: '2026-06-09T00:00:01.000Z', |
| 110 | ...overrides, |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | describe('emitExecutionCompletedEvent', () => { |
| 115 | beforeEach(() => { |