summaryrefslogtreecommitdiff
path: root/js/fetch_test.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2018-12-21 04:47:09 -0500
committerRyan Dahl <ry@tinyclouds.org>2018-12-21 04:47:09 -0500
commite4be1209b6216ad12729981947c0725b5ccc55a5 (patch)
tree3f13f4d49c8ca38acd2ec755523e1cb9660646a8 /js/fetch_test.ts
parent105a5193b5aa231f0169d1113792f5c80e7438de (diff)
Avoid fetch segfault on empty Uri (#1394)
Diffstat (limited to 'js/fetch_test.ts')
-rw-r--r--js/fetch_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/fetch_test.ts b/js/fetch_test.ts
index 74a383649..cd3e6ebf0 100644
--- a/js/fetch_test.ts
+++ b/js/fetch_test.ts
@@ -47,6 +47,17 @@ testPerm({ net: true }, async function responseClone() {
}
});
+testPerm({ net: true }, async function fetchEmptyInvalid() {
+ let err;
+ try {
+ await fetch("");
+ } catch (err_) {
+ err = err_;
+ }
+ assertEqual(err.kind, deno.ErrorKind.InvalidUri);
+ assertEqual(err.name, "InvalidUri");
+});
+
// TODO(ry) The following tests work but are flaky. There's a race condition
// somewhere. Here is what one of these flaky failures looks like:
//