aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-url-format-invalid-input.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-url-format-invalid-input.js')
-rw-r--r--test/parallel/test-url-format-invalid-input.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/parallel/test-url-format-invalid-input.js b/test/parallel/test-url-format-invalid-input.js
index a94546aaf2..4f0f1a11d7 100644
--- a/test/parallel/test-url-format-invalid-input.js
+++ b/test/parallel/test-url-format-invalid-input.js
@@ -14,13 +14,14 @@ const throwsObjsAndReportTypes = new Map([
]);
for (const [urlObject, type] of throwsObjsAndReportTypes) {
- const error = common.expectsError({
+ common.expectsError(function() {
+ url.format(urlObject);
+ }, {
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "urlObject" argument must be one of type Object or string. ' +
`Received type ${type}`
});
- assert.throws(function() { url.format(urlObject); }, error);
}
assert.strictEqual(url.format(''), '');
assert.strictEqual(url.format({}), '');