node/test/parallel/test-child-process-spawn-error.js
Vse Mozhet Byt 5b74e635e5
test: reduce string concatenations
Backport-PR-URL: https://github.com/nodejs/node/pull/13835
PR-URL: https://github.com/nodejs/node/pull/12735
Refs: https://github.com/nodejs/node/pull/12455
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-07-11 17:43:49 +01:00

17 lines
597 B
JavaScript

'use strict';
const common = require('../common');
const spawn = require('child_process').spawn;
const assert = require('assert');
const enoentPath = 'foo123';
const spawnargs = ['bar'];
assert.strictEqual(common.fileExists(enoentPath), false);
const enoentChild = spawn(enoentPath, spawnargs);
enoentChild.on('error', common.mustCall(function(err) {
assert.strictEqual(err.code, 'ENOENT');
assert.strictEqual(err.errno, 'ENOENT');
assert.strictEqual(err.syscall, `spawn ${enoentPath}`);
assert.strictEqual(err.path, enoentPath);
assert.deepStrictEqual(err.spawnargs, spawnargs);
}));