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>
This commit is contained in:
parent
8d2bd5fa88
commit
c20c570282
@ -24,7 +24,7 @@ assert.throws(() => {
|
||||
hints: 100,
|
||||
family: 0,
|
||||
all: false
|
||||
}, common.noop);
|
||||
}, 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.noop);
|
||||
}, common.mustNotCall());
|
||||
}, /^TypeError: Invalid argument: family must be 4 or 6$/);
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user