summaryrefslogtreecommitdiff
path: root/test/parallel/test-url-parse-invalid-input.js
diff options
context:
space:
mode:
authorLovell Fuller <github@lovell.info>2017-03-30 13:21:49 +0100
committerJames M Snell <jasnell@gmail.com>2017-04-04 10:56:21 -0700
commit2ff107dad7faaef617916d84101bb43b73dbd4e6 (patch)
treedc8f7bc4700c19171383aef860821bb9f6c0c513 /test/parallel/test-url-parse-invalid-input.js
parenteefdf452c35fd79d5588d2338989d55ebaf52763 (diff)
downloadandroid-node-v8-2ff107dad7faaef617916d84101bb43b73dbd4e6.tar.gz
android-node-v8-2ff107dad7faaef617916d84101bb43b73dbd4e6.tar.bz2
android-node-v8-2ff107dad7faaef617916d84101bb43b73dbd4e6.zip
test: add case for url.parse throwing a URIError
The auth property of a URL is decoded via decodeURIComponent, which can throw a URIError. The test URL here will trigger this. Adds documentation on the possible errors url.parse can throw. PR-URL: https://github.com/nodejs/node/pull/12135 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-url-parse-invalid-input.js')
-rw-r--r--test/parallel/test-url-parse-invalid-input.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-url-parse-invalid-input.js b/test/parallel/test-url-parse-invalid-input.js
index 17fac57e14..688d48beb6 100644
--- a/test/parallel/test-url-parse-invalid-input.js
+++ b/test/parallel/test-url-parse-invalid-input.js
@@ -16,3 +16,5 @@ const url = require('url');
].forEach(function(val) {
assert.throws(function() { url.parse(val); }, TypeError);
});
+
+assert.throws(function() { url.parse('http://%E0%A4%A@fail'); }, /^URIError: URI malformed$/);