File tree Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,31 @@ assert.deepStrictEqual(dns.getServers(), portsExpected);
135135dns . setServers ( [ ] ) ;
136136assert . deepStrictEqual ( dns . getServers ( ) , [ ] ) ;
137137
138- common . expectsError ( ( ) => {
139- dns . resolve ( 'example.com' , [ ] , common . mustNotCall ( ) ) ;
140- } , {
141- code : 'ERR_INVALID_ARG_TYPE' ,
142- type : TypeError ,
143- message : 'The "rrtype" argument must be of type string. ' +
144- 'Received type object'
145- } ) ;
138+ {
139+ const errObj = {
140+ code : 'ERR_INVALID_ARG_TYPE' ,
141+ type : TypeError ,
142+ message : 'The "rrtype" argument must be of type string. ' +
143+ 'Received type object'
144+ } ;
145+ common . expectsError ( ( ) => {
146+ dns . resolve ( 'example.com' , [ ] , common . mustNotCall ( ) ) ;
147+ } , errObj ) ;
148+ common . expectsError ( ( ) => {
149+ dnsPromises . resolve ( 'example.com' , [ ] ) ;
150+ } , errObj ) ;
151+ }
152+ {
153+ const errObj = {
154+ code : 'ERR_INVALID_ARG_TYPE' ,
155+ type : TypeError ,
156+ message : 'The "name" argument must be of type string. ' +
157+ 'Received type undefined'
158+ } ;
159+ common . expectsError ( ( ) => {
160+ dnsPromises . resolve ( ) ;
161+ } , errObj ) ;
162+ }
146163
147164// dns.lookup should accept only falsey and string values
148165{
You can’t perform that action at this time.
0 commit comments