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