Skip to content

Commit 9bbab91

Browse files
namtargos
nam
authored andcommitted
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>
1 parent d0cdcb6 commit 9bbab91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-net-listen-exclusive-random-ports.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ if (cluster.isMaster) {
99
const worker1 = cluster.fork();
1010

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

1516
worker2.on('message', function(port2) {
16-
assert.strictEqual(port2, port2 | 0, 'second worker could not listen');
17+
assert.strictEqual(port2, port2 | 0,
18+
`second worker could not listen on port ${port2}`);
1719
assert.notStrictEqual(port1, port2, 'ports should not be equal');
1820
worker1.kill();
1921
worker2.kill();

0 commit comments

Comments
 (0)