Skip to content

Commit

Permalink
squash: skip test when ipv6 is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Dec 14, 2022
1 parent 4a1914c commit a117b3f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/parallel/test-net-happy-eyeballs.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ if (common.hasIPv6) {
}

// Test that the option can be disabled
{
if (common.hasIPv6) {
createDnsServer('::1', '127.0.0.1', common.mustCall(function({ dnsServer, lookup }) {
const ipv4Server = createServer((socket) => {
socket.on('data', common.mustCall(() => {
Expand All @@ -199,13 +199,8 @@ if (common.hasIPv6) {

connection.on('ready', common.mustNotCall());
connection.on('error', common.mustCall((error) => {
if (common.hasIPv6) {
assert.strictEqual(error.code, 'ECONNREFUSED');
assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`);
} else {
assert.strictEqual(error.code, 'EAFNOSUPPORT');
assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`);
}
assert.strictEqual(error.code, 'ECONNREFUSED');
assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`);

ipv4Server.close();
dnsServer.close();
Expand Down

0 comments on commit a117b3f

Please sign in to comment.