Skip to content
Permalink
Browse files

test: include port in assertion message

PR-URL: #20889
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information...
nammn authored and tniessen committed May 22, 2018
1 parent 468ab45 commit 76a1feb4511f004efd30e5db98592ef88c85fd11
Showing with 4 additions and 2 deletions.
  1. +4 −2 test/parallel/test-net-listen-exclusive-random-ports.js
@@ -9,11 +9,13 @@ if (cluster.isMaster) {
const worker1 = cluster.fork();

worker1.on('message', function(port1) {
assert.strictEqual(port1, port1 | 0, 'first worker could not listen');
assert.strictEqual(port1, port1 | 0,
`first worker could not listen on port ${port1}`);
const worker2 = cluster.fork();

worker2.on('message', function(port2) {
assert.strictEqual(port2, port2 | 0, 'second worker could not listen');
assert.strictEqual(port2, port2 | 0,
`second worker could not listen on port ${port2}`);
assert.notStrictEqual(port1, port2, 'ports should not be equal');
worker1.kill();
worker2.kill();

0 comments on commit 76a1feb

Please sign in to comment.
You can’t perform that action at this time.