summaryrefslogtreecommitdiff
path: root/test/parallel/test-dns.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-05-17 13:37:30 -0700
committerRich Trott <rtrott@gmail.com>2017-05-28 19:49:27 -0700
commit758a17f1d5f5985f6d5e3823e0c4759e78252c52 (patch)
treea89dc61d4b8b3d947f3325bec0125fc60da9ee53 /test/parallel/test-dns.js
parenta94b98e7e119a44580650ac34c2d1b7b0f3df401 (diff)
downloadandroid-node-v8-758a17f1d5f5985f6d5e3823e0c4759e78252c52.tar.gz
android-node-v8-758a17f1d5f5985f6d5e3823e0c4759e78252c52.tar.bz2
android-node-v8-758a17f1d5f5985f6d5e3823e0c4759e78252c52.zip
dns: return TypeError on invalid resolve() input
Synchronize the argument list for `dns.resolve()` with what's in the documentation. Improve the error for a bad `rrtype` to be a `TypeError` rather than an `Error`. PR-URL: https://github.com/nodejs/node/pull/13090 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-dns.js')
-rw-r--r--test/parallel/test-dns.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js
index b409bb5e66..a605e76c1d 100644
--- a/test/parallel/test-dns.js
+++ b/test/parallel/test-dns.js
@@ -91,10 +91,8 @@ assert.doesNotThrow(() => dns.setServers([]));
assert.deepStrictEqual(dns.getServers(), []);
assert.throws(() => {
- dns.resolve('test.com', [], common.mustNotCall());
-}, function(err) {
- return !(err instanceof TypeError);
-}, 'Unexpected error');
+ dns.resolve('example.com', [], common.mustNotCall());
+}, /^TypeError: "rrtype" argument must be a string$/);
// dns.lookup should accept only falsey and string values
{