| 153 | } as const |
| 154 | |
| 155 | function setupSuccessfulRun(summary: Partial<ExecutionSummary> = {}) { |
| 156 | const defaultSummary: ExecutionSummary = { |
| 157 | totalBlocks: 1, |
| 158 | executedBlocks: 1, |
| 159 | failedBlocks: 0, |
| 160 | totalDurationMs: 100, |
| 161 | ...summary, |
| 162 | } |
| 163 | mockStart.mockResolvedValue(undefined) |
| 164 | mockRunFile.mockResolvedValue(defaultSummary) |
| 165 | mockRunProject.mockResolvedValue(defaultSummary) |
| 166 | mockStop.mockResolvedValue(undefined) |
| 167 | return defaultSummary |
| 168 | } |
| 169 | |
| 170 | function setupStartFailure(errorMessage: string) { |
| 171 | mockStart.mockRejectedValue(new Error(errorMessage)) |