test: refactor child-process-spawn-error
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>
This commit is contained in:
parent
9dcf07a366
commit
5be66db688
@ -1,13 +1,13 @@
|
||||
'use strict';
|
||||
var common = require('../common');
|
||||
var spawn = require('child_process').spawn;
|
||||
var assert = require('assert');
|
||||
const common = require('../common');
|
||||
const spawn = require('child_process').spawn;
|
||||
const assert = require('assert');
|
||||
|
||||
var enoentPath = 'foo123';
|
||||
var spawnargs = ['bar'];
|
||||
const enoentPath = 'foo123';
|
||||
const spawnargs = ['bar'];
|
||||
assert.strictEqual(common.fileExists(enoentPath), false);
|
||||
|
||||
var enoentChild = spawn(enoentPath, spawnargs);
|
||||
const enoentChild = spawn(enoentPath, spawnargs);
|
||||
enoentChild.on('error', common.mustCall(function(err) {
|
||||
assert.strictEqual(err.code, 'ENOENT');
|
||||
assert.strictEqual(err.errno, 'ENOENT');
|
||||
|
Loading…
x
Reference in New Issue
Block a user