From fa5c706becbdcf0d5f7d939e43f0feb8dfdd98e0 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 3 Nov 2017 13:59:39 -0700 Subject: [PATCH] test: refactor exitedAfterDisconnect test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * minor refactoring to conform with test-writing layout guidelines * rename test to use current terminology rather than deprecated terminology * assert.strictEqual() -> assert.ok() PR-URL: https://github.com/nodejs/node/pull/16729 Reviewed-By: Colin Ihrig Reviewed-By: Eugene Ostroukhov Reviewed-By: Gireesh Punathil Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso --- ...=> test-cluster-disconnect-exitedAfterDisconnect-race.js} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename test/parallel/{test-cluster-disconnect-suicide-race.js => test-cluster-disconnect-exitedAfterDisconnect-race.js} (87%) diff --git a/test/parallel/test-cluster-disconnect-suicide-race.js b/test/parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js similarity index 87% rename from test/parallel/test-cluster-disconnect-suicide-race.js rename to test/parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js index b65af6453e3f61..db2aa6d34a6116 100644 --- a/test/parallel/test-cluster-disconnect-suicide-race.js +++ b/test/parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js @@ -1,8 +1,9 @@ 'use strict'; +const common = require('../common'); + // Test should fail in Node.js 5.4.1 and pass in later versions. -const common = require('../common'); const assert = require('assert'); const cluster = require('cluster'); @@ -19,7 +20,7 @@ let eventFired = false; cluster.worker.disconnect(); process.nextTick(common.mustCall(() => { - assert.strictEqual(eventFired, false, 'disconnect event should wait for ack'); + assert.ok(!eventFired, 'disconnect event should wait for ack'); })); cluster.worker.on('disconnect', common.mustCall(() => {