(result: RunCLIResult)
| 92 | } |
| 93 | |
| 94 | function parseJson(result: RunCLIResult): any { |
| 95 | try { |
| 96 | return JSON.parse(result.stdout); |
| 97 | } catch (error) { |
| 98 | throw new Error( |
| 99 | `Could not parse JSON.\nCommand: ${result.command}\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}\n${String(error)}` |
| 100 | ); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | it('defaults to Git without prompting in interactive setup', async () => { |
| 105 | process.env = { |