@@ -29,11 +29,6 @@ common.expectWarning({
2929 'internal/test/binding' : [
3030 'These APIs are for internal testing only. Do not use them.' ,
3131 ] ,
32- // For calling `dns.lookup` with falsy `hostname`.
33- 'DeprecationWarning' : {
34- DEP0118 : 'The provided hostname "false" is not a valid ' +
35- 'hostname, and is supported in the dns module solely for compatibility.'
36- }
3732} ) ;
3833
3934assert . throws ( ( ) => {
@@ -145,12 +140,13 @@ assert.throws(() => dnsPromises.lookup(false, () => {}),
145140( async function ( ) {
146141 let res ;
147142
148- res = await dnsPromises . lookup ( false , {
143+ await assert . rejects ( dnsPromises . lookup ( false , {
149144 hints : 0 ,
150145 family : 0 ,
151146 all : true
147+ } ) , {
148+ code : 'ERR_INVALID_ARG_VALUE' ,
152149 } ) ;
153- assert . deepStrictEqual ( res , [ ] ) ;
154150
155151 res = await dnsPromises . lookup ( '127.0.0.1' , {
156152 hints : 0 ,
@@ -167,14 +163,13 @@ assert.throws(() => dnsPromises.lookup(false, () => {}),
167163 assert . deepStrictEqual ( res , { address : '127.0.0.1' , family : 4 } ) ;
168164} ) ( ) . then ( common . mustCall ( ) ) ;
169165
170- dns . lookup ( false , {
166+ assert . throws ( ( ) => dns . lookup ( false , {
171167 hints : 0 ,
172168 family : 0 ,
173169 all : true
174- } , common . mustSucceed ( ( result , addressType ) => {
175- assert . deepStrictEqual ( result , [ ] ) ;
176- assert . strictEqual ( addressType , undefined ) ;
177- } ) ) ;
170+ } , common . mustNotCall ( ) ) , {
171+ code : 'ERR_INVALID_ARG_VALUE' ,
172+ } ) ;
178173
179174dns . lookup ( '127.0.0.1' , {
180175 hints : 0 ,
0 commit comments