(fn, code, expectPidType = 'number')
| 25 | const child_process = require('child_process'); |
| 26 | |
| 27 | function test(fn, code, expectPidType = 'number') { |
| 28 | const child = fn('does-not-exist', common.mustCall(function(err) { |
| 29 | assert.strictEqual(err.code, code); |
| 30 | assert(err.cmd.includes('does-not-exist')); |
| 31 | })); |
| 32 | |
| 33 | assert.strictEqual(typeof child.pid, expectPidType); |
| 34 | } |
| 35 | |
| 36 | // With `shell: true`, expect pid (of the shell) |
| 37 | if (common.isWindows) { |
no test coverage detected
searching dependent graphs…