mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
5be66db688
Use const instead of var for assignments. PR-URL: https://github.com/nodejs/node/pull/9951 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
18 lines
597 B
JavaScript
18 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);
|
|
}));
|