Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish test coverage for lib/internal/dns/utils.js #27006

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lib/internal/dns/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class Resolver {

if (ipVersion !== 0) {
const port =
parseInt(serv.replace(addrSplitRE, '$2')) ||
IANA_DNS_PORT;
parseInt(serv.replace(addrSplitRE, '$2')) || IANA_DNS_PORT;
return newSet.push([ipVersion, match[1], port]);
}
}
Expand Down Expand Up @@ -103,18 +102,18 @@ let defaultResolver = new Resolver();
const resolverKeys = [
'getServers',
'resolve',
'resolveAny',
'resolve4',
'resolve6',
'resolveAny',
'resolveCname',
'resolveMx',
'resolveNaptr',
'resolveNs',
'resolveTxt',
'resolveSrv',
'resolvePtr',
'resolveNaptr',
'resolveSoa',
'reverse'
'resolveSrv',
'resolveTxt',
'reverse',
];

function getDefaultResolver() {
Expand Down
6 changes: 4 additions & 2 deletions test/parallel/test-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ const ports = [
'4.4.4.4:53',
'[2001:4860:4860::8888]:53',
'103.238.225.181:666',
'[fe80::483a:5aff:fee6:1f04]:666'
'[fe80::483a:5aff:fee6:1f04]:666',
'[fe80::483a:5aff:fee6:1f04]',
];
const portsExpected = [
'4.4.4.4',
'2001:4860:4860::8888',
'103.238.225.181:666',
'[fe80::483a:5aff:fee6:1f04]:666'
'[fe80::483a:5aff:fee6:1f04]:666',
'fe80::483a:5aff:fee6:1f04',
];
dns.setServers(ports);
assert.deepStrictEqual(dns.getServers(), portsExpected);
Expand Down