(code)
| 9 | // |
| 10 | |
| 11 | function runExitInSubprocess(code) { |
| 12 | const script = code !== undefined |
| 13 | ? `var shell = require("."); shell.exit(${code});` |
| 14 | : 'var shell = require("."); shell.exit();'; |
| 15 | const result = shell.exec( |
| 16 | `${JSON.stringify(shell.config.execPath)} -e ${JSON.stringify(script)}` |
| 17 | ); |
| 18 | const actualReturnCode = result.code; |
| 19 | return actualReturnCode; |
| 20 | } |
| 21 | |
| 22 | test('exit with success status code', t => { |
| 23 | t.is(runExitInSubprocess(0), 0); |
no outgoing calls
no test coverage detected
searching dependent graphs…