From f5691fa6b66ee0b978855514926c1e3387ad568f Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 30 Jun 2020 09:55:27 -0400 Subject: [PATCH] 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 Reviewed-By: Anna Henningsen Reviewed-By: Shelley Vohr Reviewed-By: Trivikram Kamat Reviewed-By: Jiawen Geng --- test/parallel/test-dgram-error-message-address.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-dgram-error-message-address.js b/test/parallel/test-dgram-error-message-address.js index 859ee560c34c01..cf243ed2e8560a 100644 --- a/test/parallel/test-dgram-error-message-address.js +++ b/test/parallel/test-dgram-error-message-address.js @@ -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');