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>
This commit is contained in:
parent
7cb98138a9
commit
8b367c5ddd
@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
var spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
var fork = require('child_process').fork;
|
const fork = require('child_process').fork;
|
||||||
|
|
||||||
// Fork, then spawn. The spawned process should not hang.
|
// Fork, then spawn. The spawned process should not hang.
|
||||||
switch (process.argv[2] || '') {
|
switch (process.argv[2] || '') {
|
||||||
@ -16,10 +16,9 @@ switch (process.argv[2] || '') {
|
|||||||
case 'spawn':
|
case 'spawn':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
common.fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkExit(statusCode) {
|
function checkExit(statusCode) {
|
||||||
assert.equal(statusCode, 0);
|
assert.strictEqual(statusCode, 0);
|
||||||
process.nextTick(process.exit);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user