From 13b1763e14e6b6b7ff9d0e37a74264ab59ed85a5 Mon Sep 17 00:00:00 2001 From: Adrian Estrada Date: Fri, 16 Dec 2016 19:02:18 -0500 Subject: [PATCH] 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 Reviewed-By: Evan Lucas Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Minwoo Jung Reviewed-By: Italo A. Casas --- test/parallel/test-child-process-fork-and-spawn.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-child-process-fork-and-spawn.js b/test/parallel/test-child-process-fork-and-spawn.js index 50615ecb79d0c6..5807147a1c947d 100644 --- a/test/parallel/test-child-process-fork-and-spawn.js +++ b/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); }