mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

* assert.equal() -> assert.strictEqual() * regex -> .include() * Change variable representing a function from `fun` to idiomatic `fn` * var -> const PR-URL: https://github.com/nodejs/node/pull/9780 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
20 lines
501 B
JavaScript
20 lines
501 B
JavaScript
'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');
|