summaryrefslogtreecommitdiff
path: root/std/http/file_server_test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-04-10 09:51:17 -0400
committerGitHub <noreply@github.com>2020-04-10 09:51:17 -0400
commit02bc58d83253fd3be61787bb28b6b02e3aa71092 (patch)
tree287491a848ee9fecf1e1e983841f040bc9bec0a4 /std/http/file_server_test.ts
parentbe71885628c3820cc4e62d229326de16a6830fec (diff)
BREAKING: Make fetch API more web compatible (#4687)
- Removes the __fetch namespace from `deno types` - Response.redirect should be a static. - Response.body should not be AsyncIterable. - Disables the deno_proxy benchmark - Makes std/examples/curl.ts buffer the body before printing to stdout
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r--std/http/file_server_test.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts
index 404d133ae..dc14d2c57 100644
--- a/std/http/file_server_test.ts
+++ b/std/http/file_server_test.ts
@@ -79,7 +79,7 @@ test(async function serveFallback(): Promise<void> {
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 404);
- res.body.close();
+ const _ = await res.text();
} finally {
killFileServer();
}
@@ -92,12 +92,12 @@ test(async function serveWithUnorthodoxFilename(): Promise<void> {
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 200);
- res.body.close();
+ let _ = await res.text();
res = await fetch("http://localhost:4500/http/testdata/test%20file.txt");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 200);
- res.body.close();
+ _ = await res.text();
} finally {
killFileServer();
}
@@ -118,7 +118,7 @@ test(async function servePermissionDenied(): Promise<void> {
try {
const res = await fetch("http://localhost:4500/");
- res.body.close();
+ const _ = await res.text();
assertStrContains(
(await errReader.readLine()) as string,
"run again with the --allow-read flag"