test: include port in assertion message
PR-URL: https://github.com/nodejs/node/pull/20889 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
468ab4519e
commit
76a1feb451
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user