File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33require ( '../common' ) ;
4- const dnsPromises = require ( 'dns' ) . promises ;
4+ const common = require ( '../common' ) ;
5+ const dns = require ( 'dns' ) ;
6+ const dnsPromises = dns . promises ;
57const { addresses } = require ( '../common/internet' ) ;
68const assert = require ( 'assert' ) ;
79
@@ -28,3 +30,17 @@ assert.rejects(
2830 message : `getaddrinfo ENOTFOUND ${ addresses . INVALID_HOST } `
2931 }
3032) ;
33+
34+ dns . lookup ( addresses . INVALID_HOST , {
35+ hints : 0 ,
36+ family : 0 ,
37+ all : true
38+ } , common . mustCall ( ( error ) => {
39+ assert . strictEqual ( error . code , 'ENOTFOUND' ) ;
40+ assert . strictEqual (
41+ error . message ,
42+ `getaddrinfo ENOTFOUND ${ addresses . INVALID_HOST } `
43+ ) ;
44+ assert . strictEqual ( error . syscall , 'getaddrinfo' ) ;
45+ assert . strictEqual ( error . hostname , addresses . INVALID_HOST ) ;
46+ } ) ) ;
You can’t perform that action at this time.
0 commit comments