summaryrefslogtreecommitdiff
path: root/cli/js/fetch_test.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2020-02-23 06:45:02 -0800
committerGitHub <noreply@github.com>2020-02-23 09:45:02 -0500
commite9fff02e9681f3eb2edee9f94db66b140e179899 (patch)
treedebb7868de81f91e0f4e67a0bcf8cc592e9c8e2b /cli/js/fetch_test.ts
parentbf48f5fa5a15e01d6f8b7eb7c3e70f6ecc91fa23 (diff)
fetch: proper error for unsupported protocol (#4085)
Diffstat (limited to 'cli/js/fetch_test.ts')
-rw-r--r--cli/js/fetch_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/js/fetch_test.ts b/cli/js/fetch_test.ts
index 2912d5d2d..54bec46be 100644
--- a/cli/js/fetch_test.ts
+++ b/cli/js/fetch_test.ts
@@ -9,6 +9,17 @@ import {
fail
} from "./test_util.ts";
+testPerm({ net: true }, async function fetchProtocolError(): Promise<void> {
+ let err;
+ try {
+ await fetch("file:///");
+ } catch (err_) {
+ err = err_;
+ }
+ assert(err instanceof TypeError);
+ assertStrContains(err.message, "not supported");
+});
+
testPerm({ net: true }, async function fetchConnectionError(): Promise<void> {
let err;
try {