summaryrefslogtreecommitdiff
path: root/std/http/file_server_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r--std/http/file_server_test.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts
index 22b318821..1fbe3ba97 100644
--- a/std/http/file_server_test.ts
+++ b/std/http/file_server_test.ts
@@ -78,6 +78,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();
} finally {
killFileServer();
}
@@ -90,11 +91,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();
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();
} finally {
killFileServer();
}
@@ -114,7 +116,8 @@ test(async function servePermissionDenied(): Promise<void> {
assert(s !== Deno.EOF && s.includes("server listening"));
try {
- await fetch("http://localhost:4500/");
+ const res = await fetch("http://localhost:4500/");
+ res.body.close();
assertStrContains(
(await errReader.readLine()) as string,
"run again with the --allow-read flag"