(stdout = '')
| 12 | } |
| 13 | |
| 14 | function recordingProcess(stdout = ''): { |
| 15 | process: SandboxProcess |
| 16 | calls: Array<ExecCall> |
| 17 | } { |
| 18 | const calls: Array<ExecCall> = [] |
| 19 | const process: SandboxProcess = { |
| 20 | exec: (command, options): Promise<ExecResult> => { |
| 21 | calls.push({ command, options }) |
| 22 | return Promise.resolve({ stdout, stderr: '', exitCode: 0 }) |
| 23 | }, |
| 24 | spawn: () => Promise.reject(new Error('unused')), |
| 25 | } |
| 26 | return { process, calls } |
| 27 | } |
| 28 | |
| 29 | describe('createExecBackedGit security', () => { |
| 30 | it('rejects a non-positive-integer depth before it reaches the shell', async () => { |
no test coverage detected