Skip to content

Commit

Permalink
test: report actual error code on failure
Browse files Browse the repository at this point in the history
Add a custom message to parallel/test-dgram-error-message-address so
that the actual error code that doesn't match the allowed errors is
output on assertion failure.

PR-URL: #34134
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
  • Loading branch information
richardlau authored and addaleax committed Sep 22, 2020
1 parent 1d25e70 commit bb54217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-dgram-error-message-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ socket_ipv6.on('listening', common.mustNotCall());
socket_ipv6.on('error', common.mustCall(function(e) {
// EAFNOSUPPORT or EPROTONOSUPPORT means IPv6 is disabled on this system.
const allowed = ['EADDRNOTAVAIL', 'EAFNOSUPPORT', 'EPROTONOSUPPORT'];
assert(allowed.includes(e.code));
assert(allowed.includes(e.code), `'${e.code}' was not one of ${allowed}.`);
assert.strictEqual(e.port, undefined);
assert.strictEqual(e.message, `bind ${e.code} 111::1`);
assert.strictEqual(e.address, '111::1');
Expand Down

0 comments on commit bb54217

Please sign in to comment.