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: #10273
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
  • Loading branch information
edsadr authored and italoacasas committed Dec 19, 2016
1 parent 7cb9813 commit 8b367c5
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 8b367c5

Please sign in to comment.