Browse Source

test: check callback not invoked on lookup error

Use `common.mustNotCall()` to confirm that callback is not invoked when
`dns.lookup()` throws.

PR-URL: https://github.com/nodejs/node/pull/13456
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
543d2de700
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 4
      test/parallel/test-dns-lookup.js

4
test/parallel/test-dns-lookup.js

@ -24,7 +24,7 @@ assert.throws(() => {
hints: 100,
family: 0,
all: false
}, () => {});
}, common.mustNotCall());
}, /^TypeError: Invalid argument: hints must use valid flags$/);
assert.throws(() => {
@ -32,7 +32,7 @@ assert.throws(() => {
hints: 0,
family: 20,
all: false
}, () => {});
}, common.mustNotCall());
}, /^TypeError: Invalid argument: family must be 4 or 6$/);
assert.doesNotThrow(() => {

Loading…
Cancel
Save