mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user