Skip to content

Commit

Permalink
Fixed IPv6 DNS test
Browse files Browse the repository at this point in the history
  • Loading branch information
Giotino committed Sep 11, 2020
1 parent c03a043 commit 9b23fe7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/http.ts
Expand Up @@ -318,11 +318,16 @@ if (IPv6supported) {
test('DNS IPv6', withServer, async (t, server, got) => {
server.get('/ok', echoIp);

const response = await got('ok', {
dnsLookupIpVersion: 'ipv6'
});
try {
const response = await got('ok', {
dnsLookupIpVersion: 'ipv6'
});

t.true(isIPv6(response.body));
t.true(isIPv6(response.body));
} catch (error) {
// If network unreachable (happens on TravisCI with Ubuntu Bionic and Focal)
t.is(error.code, 'ENETUNREACH');
}
});
}

Expand Down

0 comments on commit 9b23fe7

Please sign in to comment.