Skip to content

Commit f5691fa

Browse files
richardlauMylesBorins
authored andcommitted
test: report actual error code on failure
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 <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent 7fc56eb commit f5691fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-dgram-error-message-address.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ socket_ipv6.on('listening', common.mustNotCall());
4747
socket_ipv6.on('error', common.mustCall(function(e) {
4848
// EAFNOSUPPORT or EPROTONOSUPPORT means IPv6 is disabled on this system.
4949
const allowed = ['EADDRNOTAVAIL', 'EAFNOSUPPORT', 'EPROTONOSUPPORT'];
50-
assert(allowed.includes(e.code));
50+
assert(allowed.includes(e.code), `'${e.code}' was not one of ${allowed}.`);
5151
assert.strictEqual(e.port, undefined);
5252
assert.strictEqual(e.message, `bind ${e.code} 111::1`);
5353
assert.strictEqual(e.address, '111::1');

0 commit comments

Comments
 (0)