Skip to content

Commit

Permalink
fixup! test: handle EUNATCH
Browse files Browse the repository at this point in the history
  • Loading branch information
abmusse committed Aug 19, 2023
1 parent 09207b8 commit f83b102
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions test/parallel/test-net-autoselectfamily-commandline-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) {
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 if (error.code === 'EADDRNOTAVAIL' || error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect ${error.code} ::1:${port} - Local (:::0)`);
} else if (error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect EUNATCH ::1:${port} - Local (:::0)`);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
}

ipv4Server.close();
Expand Down
7 changes: 5 additions & 2 deletions test/parallel/test-net-autoselectfamily-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) {
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 if (error.code === 'EADDRNOTAVAIL' || error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect ${error.code} ::1:${port} - Local (:::0)`);
} else if (error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect EUNATCH ::1:${port} - Local (:::0)`);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
}

ipv4Server.close();
Expand Down
7 changes: 5 additions & 2 deletions test/parallel/test-net-autoselectfamily.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,11 @@ if (common.hasIPv6) {
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 if (error.code === 'EADDRNOTAVAIL' || error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect ${error.code} ::1:${port} - Local (:::0)`);
} else if (error.code === 'EUNATCH') {
assert.strictEqual(error.message, `connect EUNATCH ::1:${port} - Local (:::0)`);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
}

ipv4Server.close();
Expand Down

0 comments on commit f83b102

Please sign in to comment.