| 119 | const mockAbortSignal = new AbortController().signal; |
| 120 | |
| 121 | const resolveShellExecution = ( |
| 122 | result: Partial<ShellExecutionResult> = {}, |
| 123 | ) => { |
| 124 | const fullResult: ShellExecutionResult = { |
| 125 | rawOutput: Buffer.from(result.output || ''), |
| 126 | output: 'Success', |
| 127 | stdout: 'Success', |
| 128 | stderr: '', |
| 129 | exitCode: 0, |
| 130 | signal: null, |
| 131 | error: null, |
| 132 | aborted: false, |
| 133 | pid: 12345, |
| 134 | ...result, |
| 135 | }; |
| 136 | resolveExecutionPromise(fullResult); |
| 137 | }; |
| 138 | |
| 139 | it('should wrap command on linux and parse pgrep output', async () => { |
| 140 | const invocation = shellTool.build({ command: 'my-command &' }); |