Browse Source

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>
v6.x
Johnny Reading 8 years ago
committed by Anna Henningsen
parent
commit
91b942ec8a
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 12
      test/parallel/test-child-process-spawn-error.js

12
test/parallel/test-child-process-spawn-error.js

@ -1,13 +1,13 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
var assert = require('assert'); const assert = require('assert');
var enoentPath = 'foo123'; const enoentPath = 'foo123';
var spawnargs = ['bar']; const spawnargs = ['bar'];
assert.strictEqual(common.fileExists(enoentPath), false); assert.strictEqual(common.fileExists(enoentPath), false);
var enoentChild = spawn(enoentPath, spawnargs); const enoentChild = spawn(enoentPath, spawnargs);
enoentChild.on('error', common.mustCall(function(err) { enoentChild.on('error', common.mustCall(function(err) {
assert.strictEqual(err.code, 'ENOENT'); assert.strictEqual(err.code, 'ENOENT');
assert.strictEqual(err.errno, 'ENOENT'); assert.strictEqual(err.errno, 'ENOENT');

Loading…
Cancel
Save