Skip to content
Permalink
Browse files

test: test error messages in test-dns-regress-7070

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...
Wallace Zhang authored and Trott committed Dec 1, 2016
1 parent 9cfecce commit be6de1a0c82a91bec2dc6b510f0aedbf2f73b6bc
Showing with 4 additions and 2 deletions.
  1. +4 −2 test/parallel/test-dns-regress-7070.js
@@ -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 be6de1a

Please sign in to comment.
You can’t perform that action at this time.