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
  • Loading branch information
edsadr committed Dec 17, 2016
1 parent 4a5c719 commit 8a4bc9e
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 8a4bc9e

Please sign in to comment.