Skip to content

Commit b8cdd15

Browse files
paivaandeersondanielleadams
authored andcommitted
test: improve test coverage of lib/dns
PR-URL: #46910 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 257c5ac commit b8cdd15

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/parallel/test-dns.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ assert.throws(() => dns.lookup('nodejs.org', 4), {
239239
name: 'TypeError'
240240
});
241241

242+
assert.throws(() => dns.lookup('', {
243+
family: 'nodejs.org',
244+
hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL,
245+
}), {
246+
code: 'ERR_INVALID_ARG_TYPE',
247+
name: 'TypeError'
248+
});
249+
242250
dns.lookup('', { family: 4, hints: 0 }, common.mustCall());
243251

244252
dns.lookup('', {
@@ -264,6 +272,16 @@ dns.lookup('', {
264272
hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL
265273
}, common.mustCall());
266274

275+
dns.lookup('', {
276+
hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL,
277+
family: 'IPv4'
278+
}, common.mustCall());
279+
280+
dns.lookup('', {
281+
hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL,
282+
family: 'IPv6'
283+
}, common.mustCall());
284+
267285
(async function() {
268286
await dnsPromises.lookup('', { family: 4, hints: 0 });
269287
await dnsPromises.lookup('', { family: 6, hints: dns.ADDRCONFIG });

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy