Skip to content

Commit

Permalink
test: improve test-child-process-fork-and-spawn
Browse files Browse the repository at this point in the history
* use const instead of var for required modules
* use assert.strictEqual instead of assert.equal
* remove unnecessary process.nextTick

PR-URL: nodejs#10273
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
  • Loading branch information
edsadr authored and cjihrig committed Dec 20, 2016
1 parent be6d362 commit 7689602
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/parallel/test-child-process-fork-and-spawn.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
const common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
var fork = require('child_process').fork;
const assert = require('assert');
const spawn = require('child_process').spawn;
const fork = require('child_process').fork;

// Fork, then spawn. The spawned process should not hang.
switch (process.argv[2] || '') {
Expand All @@ -16,10 +16,9 @@ switch (process.argv[2] || '') {
case 'spawn':
break;
default:
assert(0);
common.fail();
}

function checkExit(statusCode) {
assert.equal(statusCode, 0);
process.nextTick(process.exit);
assert.strictEqual(statusCode, 0);
}

0 comments on commit 7689602

Please sign in to comment.