(
command: string,
simulation: (cp: typeof mockChildProcess, ac: AbortController) => void,
)
| 79 | |
| 80 | // Helper function to run a standard execution simulation |
| 81 | const simulateExecution = async ( |
| 82 | command: string, |
| 83 | simulation: (cp: typeof mockChildProcess, ac: AbortController) => void, |
| 84 | ) => { |
| 85 | const abortController = new AbortController(); |
| 86 | const handle = ShellExecutionService.execute( |
| 87 | command, |
| 88 | '/test/dir', |
| 89 | onOutputEventMock, |
| 90 | abortController.signal, |
| 91 | ); |
| 92 | |
| 93 | await new Promise((resolve) => setImmediate(resolve)); |
| 94 | simulation(mockChildProcess, abortController); |
| 95 | const result = await handle.result; |
| 96 | return { result, handle, abortController }; |
| 97 | }; |
| 98 | |
| 99 | describe('Successful Execution', () => { |
| 100 | it('should execute a command and capture stdout and stderr', async () => { |
no test coverage detected