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)`);