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 MylesBorins committed Jul 16, 2020
1 parent 7fc56eb commit f5691fa
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 f5691fa

Please sign in to comment.