You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
501 B

'use strict';
const common = require('../common');
const assert = require('assert');
const child_process = require('child_process');
function test(fn, code) {
fn('does-not-exist', common.mustCall(function(err) {
assert.strictEqual(err.code, code);
assert(err.cmd.includes('does-not-exist'));
}));
}
if (common.isWindows) {
test(child_process.exec, 1); // exit code of cmd.exe
} else {
test(child_process.exec, 127); // exit code of /bin/sh
}
test(child_process.execFile, 'ENOENT');