Skip to content

Commit

Permalink
test: include port in assertion message
Browse files Browse the repository at this point in the history
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
nam authored and targos committed May 25, 2018
1 parent d0cdcb6 commit 9bbab91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-net-listen-exclusive-random-ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9bbab91

Please sign in to comment.