Skip to content

Commit

Permalink
test: check callback not invoked on lookup error
Browse files Browse the repository at this point in the history
Use `common.mustNotCall()` to confirm that callback is not invoked when
`dns.lookup()` throws.

PR-URL: #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>
  • Loading branch information
Trott authored and MylesBorins committed Aug 16, 2017
1 parent 91fb0cb commit 543d2de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-dns-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ assert.throws(() => {
hints: 100,
family: 0,
all: false
}, () => {});
}, common.mustNotCall());
}, /^TypeError: Invalid argument: hints must use valid flags$/);

assert.throws(() => {
dns.lookup(false, {
hints: 0,
family: 20,
all: false
}, () => {});
}, common.mustNotCall());
}, /^TypeError: Invalid argument: family must be 4 or 6$/);

assert.doesNotThrow(() => {
Expand Down

0 comments on commit 543d2de

Please sign in to comment.