Skip to content

Commit bb86904

Browse files
gibfahnMylesBorins
authored andcommitted
test: fix ::1 error in test-dns-ipv6
If ::1 can't be resolved, the test should still pass. PR-URL: #8254 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 5c417ee commit bb86904

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/internet/test-dns-ipv6.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ TEST(function test_lookup_all_ipv6(done) {
179179

180180
TEST(function test_lookupservice_ip_ipv6(done) {
181181
var req = dns.lookupService('::1', 80, function(err, host, service) {
182-
if (err) throw err;
182+
if (err) {
183+
// Not skipping the test, rather checking an alternative result,
184+
// i.e. that ::1 may not be configured (e.g. in /etc/hosts)
185+
assert.strictEqual(err.code, 'ENOTFOUND');
186+
return done();
187+
}
183188
assert.equal(typeof host, 'string');
184189
assert(host);
185190

0 commit comments

Comments
 (0)