Browse Source

test: improve test-child-process-fork-and-spawn

* use const instead of var for required modules
* use assert.strictEqual instead of assert.equal
* remove unnecessary process.nextTick

PR-URL: https://github.com/nodejs/node/pull/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>
v6.x
Adrian Estrada 8 years ago
committed by Myles Borins
parent
commit
a18f72d8d2
  1. 11
      test/parallel/test-child-process-fork-and-spawn.js

11
test/parallel/test-child-process-fork-and-spawn.js

@ -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] || '') {
@ -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);
}

Loading…
Cancel
Save