diff --git a/test/parallel/test-url-parse-invalid-input.js b/test/parallel/test-url-parse-invalid-input.js index 688d48beb6c2b4..a6de25e10c1501 100644 --- a/test/parallel/test-url-parse-invalid-input.js +++ b/test/parallel/test-url-parse-invalid-input.js @@ -12,9 +12,13 @@ const url = require('url'); 0.0, 0, [], - {} -].forEach(function(val) { - assert.throws(function() { url.parse(val); }, TypeError); + {}, + () => {}, + Symbol('foo') +].forEach((val) => { + assert.throws(() => { url.parse(val); }, + /^TypeError: Parameter "url" must be a string, not (undefined|boolean|number|object|function|symbol)$/); }); -assert.throws(function() { url.parse('http://%E0%A4%A@fail'); }, /^URIError: URI malformed$/); +assert.throws(() => { url.parse('http://%E0%A4%A@fail'); }, + /^URIError: URI malformed$/);