From 797e9411ce377ee3b7485296f40931788d255893 Mon Sep 17 00:00:00 2001 From: Livia Medeiros Date: Sun, 19 Feb 2023 01:32:05 +0900 Subject: [PATCH] test: fix `test-net-autoselectfamily` for kernel without IPv6 support PR-URL: https://github.com/nodejs/node/pull/45856 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Paolo Insogna --- test/parallel/test-net-happy-eyeballs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-net-happy-eyeballs.js b/test/parallel/test-net-happy-eyeballs.js index a7b19a074edd8b..9210a20f8d97d3 100644 --- a/test/parallel/test-net-happy-eyeballs.js +++ b/test/parallel/test-net-happy-eyeballs.js @@ -202,6 +202,8 @@ if (common.hasIPv6) { 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)`);