Skip to content

Commit

Permalink
test: fix ::1 error in test-dns-ipv6
Browse files Browse the repository at this point in the history
If ::1 can't be resolved, the test should still pass.

PR-URL: nodejs#8254
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
gibfahn authored and Fishrock123 committed Sep 8, 2016
1 parent 48af608 commit cb9e1cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/internet/test-dns-ipv6.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ TEST(function test_lookup_all_ipv6(done) {

TEST(function test_lookupservice_ip_ipv6(done) {
var req = dns.lookupService('::1', 80, function(err, host, service) {
if (err) throw err;
if (err) {
// Not skipping the test, rather checking an alternative result,
// i.e. that ::1 may not be configured (e.g. in /etc/hosts)
assert.strictEqual(err.code, 'ENOTFOUND');
return done();
}
assert.equal(typeof host, 'string');
assert(host);
assert(['http', 'www', '80'].includes(service));
Expand Down

0 comments on commit cb9e1cf

Please sign in to comment.