-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor child-process-spawn-error
- Using const instead of var for assignments. - let is not used since there are no reassignments or block scopes. - assert.equals was changed to assert.strictEquals
- Loading branch information
Johnny Reading
committed
Dec 1, 2016
1 parent
5887c2b
commit 871b018
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
'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.equal(common.fileExists(enoentPath), false); | ||
|
||
var enoentChild = spawn(enoentPath, spawnargs); | ||
const enoentChild = spawn(enoentPath, spawnargs); | ||
enoentChild.on('error', common.mustCall(function(err) { | ||
assert.equal(err.code, 'ENOENT'); | ||
assert.equal(err.errno, 'ENOENT'); | ||
assert.equal(err.syscall, 'spawn ' + enoentPath); | ||
assert.equal(err.path, enoentPath); | ||
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); | ||
})); |