From 25b76a44a7582bcd605ec7218fd0545c13e17944 Mon Sep 17 00:00:00 2001 From: Wallace Zhang Date: Thu, 1 Dec 2016 12:07:23 -0600 Subject: [PATCH] test: test error messages in test-dns-regress-7070 Add a RegExp as a second argument to assert.throws(). PR-URL: https://github.com/nodejs/node/pull/10058 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- test/parallel/test-dns-regress-7070.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-dns-regress-7070.js b/test/parallel/test-dns-regress-7070.js index 25cf60cf6a19f2..eb939b47559a9d 100644 --- a/test/parallel/test-dns-regress-7070.js +++ b/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$/);