Skip to content

Commit b8cdd15

Browse files
paivaandeersondanielleadams
authored andcommitted
test: improve test coverage of lib/dns
PR-URL: #46910 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
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
(asyncfunction(){
268286
awaitdnsPromises.lookup('',{family: 4,hints: 0});
269287
awaitdnsPromises.lookup('',{family: 6,hints: dns.ADDRCONFIG});

0 commit comments

Comments
(0)