Skip to content

Commit

Permalink
cluster: Using common.mustCall to wrap callback in test-inspect-suppo…
Browse files Browse the repository at this point in the history
…rt-for-node_options

Using common.mustCall to wrap callback and added assert to replace if-fail
in test-inspect-support-for-node_options. PR nodejs#19165

Fixes : nodejs#19026
  • Loading branch information
sameer-coder committed Mar 16, 2018
1 parent ff81da0 commit d2cf4a4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/parallel/test-inspect-support-for-node_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ function checkForInspectSupport(flag) {
worker.disconnect();
});

cluster.on('exit', (worker, code, signal) => {
if (worker.exitedAfterDisconnect === false) {
assert.fail(`For NODE_OPTIONS ${nodeOptions}, failed to start cluster`);
}
});
cluster.on('exit', common.mustCall((worker, code, signal) => {
const errMsg = `For NODE_OPTIONS ${nodeOptions}, failed to start cluster`;
assert.strictEqual(worker.exitedAfterDisconnect, true, errMsg);
}, 2));
}
}

0 comments on commit d2cf4a4

Please sign in to comment.