From 8d02f566a5c64b4e4e8c95df012c0bf018bd147b Mon Sep 17 00:00:00 2001 From: Livia Medeiros Date: Thu, 8 Jun 2023 02:56:28 +0900 Subject: [PATCH] test: fix `test-net-autoselectfamily` for kernel without IPv6 support PR-URL: https://github.com/nodejs/node/pull/48265 Reviewed-By: Luigi Pinca --- test/parallel/test-net-autoselectfamily-commandline-option.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-net-autoselectfamily-commandline-option.js b/test/parallel/test-net-autoselectfamily-commandline-option.js index 5687d31b2eec42..a99bf02cf02d3a 100644 --- a/test/parallel/test-net-autoselectfamily-commandline-option.js +++ b/test/parallel/test-net-autoselectfamily-commandline-option.js @@ -85,6 +85,8 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) { if (common.hasIPv6) { assert.strictEqual(error.code, 'ECONNREFUSED'); assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`); + } else if (error.code === 'EAFNOSUPPORT') { + assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`); } else { assert.strictEqual(error.code, 'EADDRNOTAVAIL'); assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);