mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 11:29:35 +00:00

In addition to removing unused vars, this also fixes an instance where booleans were set presumably to check something but then never used. This now confirms that the events that were setting the booleans are fired. PR-URL: https://github.com/nodejs/node/pull/4425 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
25 lines
625 B
JavaScript
25 lines
625 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var spawn = require('child_process').spawn;
|
|
var assert = require('assert');
|
|
|
|
var errors = 0;
|
|
|
|
var enoentPath = 'foo123';
|
|
var spawnargs = ['bar'];
|
|
assert.equal(common.fileExists(enoentPath), false);
|
|
|
|
var enoentChild = spawn(enoentPath, spawnargs);
|
|
enoentChild.on('error', function(err) {
|
|
assert.equal(err.code, 'ENOENT');
|
|
assert.equal(err.errno, 'ENOENT');
|
|
assert.equal(err.syscall, 'spawn ' + enoentPath);
|
|
assert.equal(err.path, enoentPath);
|
|
assert.deepEqual(err.spawnargs, spawnargs);
|
|
errors++;
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(1, errors);
|
|
});
|