test: refactor exitedAfterDisconnect test

* 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 <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Rich Trott 2017-11-03 13:59:39 -07:00
parent 9f3d59eabb
commit 3a4f0e9b76

View File

@ -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(() => {