GeezerVison is showing github.com — test: improve test coverage of lib/dns · nodejs/node@b8cdd15
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-dns.js +18Lines changed: 18 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -239,6 +239,14 @@ assert.throws(() => dns.lookup('nodejs.org', 4), { | 239 | 239 | name: 'TypeError' | 240 | 240 | }); | 241 | 241 |
| | 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 | + | 242 | 250 | dns.lookup('', { family: 4, hints: 0 }, common.mustCall()); | 243 | 251 |
| 244 | 252 | dns.lookup('', { | @@ -264,6 +272,16 @@ dns.lookup('', { | 264 | 272 | hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL | 265 | 273 | }, common.mustCall()); | 266 | 274 |
| | 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 | + | 267 | 285 | (async function() { | 268 | 286 | await dnsPromises.lookup('', { family: 4, hints: 0 }); | 269 | 287 | await dnsPromises.lookup('', { family: 6, hints: dns.ADDRCONFIG }); | |
|