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 14, 2017
1 parent 7c2befc commit c15393c
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 c15393c

Please sign in to comment.