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 <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
zjyw authored and evanlucas committed Jan 4, 2017
1 parent 8a9d68a commit e9b2325
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 e9b2325

Please sign in to comment.