* Spawns a CLI process synchrously * @param {string|null} command * @param {string[]} args * @param {{}} [options] * @returns {{output: *, stdout: string, stderr: string, status: number}}
(command, args, options)
| 20 | * @returns {{output: *, stdout: string, stderr: string, status: number}} |
| 21 | */ |
| 22 | function spawnCLI (command, args, options) { |
| 23 | 'use strict'; |
| 24 | var nargs = ['src/cli/cli.js']; |
| 25 | if (command) { nargs.push(command);} |
| 26 | args = nargs.concat(args); |
| 27 | var otp = spawnSync('node', args, options), |
| 28 | stdout = otp.stdout.toString(), |
| 29 | stderr = otp.stderr.toString(), |
| 30 | output = otp.output[0], |
| 31 | status = otp.status; |
| 32 | |
| 33 | return {stdout: stdout, stderr: stderr, output: output, status: status}; |
| 34 | } |
| 35 | |
| 36 | describe('showdown cli', function () { |
| 37 | 'use strict'; |
no outgoing calls
no test coverage detected
searching dependent graphs…