(
overrides: Partial<CommandResponse> = {},
)
| 32 | export const mockProcess = { pid: 12345 } as unknown as ChildProcess; |
| 33 | |
| 34 | export function createMockCommandResponse( |
| 35 | overrides: Partial<CommandResponse> = {}, |
| 36 | ): CommandResponse { |
| 37 | return { |
| 38 | success: overrides.success ?? true, |
| 39 | output: overrides.output ?? '', |
| 40 | error: overrides.error, |
| 41 | process: overrides.process ?? mockProcess, |
| 42 | exitCode: overrides.exitCode ?? (overrides.success === false ? 1 : 0), |
| 43 | }; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Create a mock executor for testing |
no outgoing calls