diff options
Diffstat (limited to 'cli/js/tests/url_test.ts')
-rw-r--r-- | cli/js/tests/url_test.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/js/tests/url_test.ts b/cli/js/tests/url_test.ts index 12e7cb26a..6529bf055 100644 --- a/cli/js/tests/url_test.ts +++ b/cli/js/tests/url_test.ts @@ -224,7 +224,7 @@ unitTest(function throwForInvalidPortConstructor(): void { ]; for (const url of urls) { - assertThrows(() => new URL(url)); + assertThrows(() => new URL(url), TypeError, "Invalid URL."); } // Do not throw for 0 & 65535 @@ -232,6 +232,14 @@ unitTest(function throwForInvalidPortConstructor(): void { new URL("https://baz.qat:0"); }); +unitTest(function throwForInvalidSchemeConstructor(): void { + assertThrows( + () => new URL("invalid_scheme://baz.qat"), + TypeError, + "Invalid URL." + ); +}); + unitTest(function doNotOverridePortIfInvalid(): void { const initialPort = "3000"; const ports = [ |