Skip to content

Commit

Permalink
test: test error messages in test-dns-regress-7070
Browse files Browse the repository at this point in the history
Add a RegExp as a second argument to assert.throws().

PR-URL: #10058
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
zjyw authored and targos committed Dec 26, 2016
1 parent 8389a1e commit 25b76a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-dns-regress-7070.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ const assert = require('assert');
const dns = require('dns');

// Should not raise assertion error. Issue #7070
assert.throws(() => dns.resolveNs([])); // bad name
assert.throws(() => dns.resolveNs('')); // bad callback
assert.throws(() => dns.resolveNs([]), // bad name
/^Error: "name" argument must be a string$/);
assert.throws(() => dns.resolveNs(''), // bad callback
/^Error: "callback" argument must be a function$/);

0 comments on commit 25b76a4

Please sign in to comment.