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
Rich Trott 8 years ago
parent
commit
c20c570282
  1. 4
      test/parallel/test-dns-lookup.js

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

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

Loading…
Cancel
Save