From f1148042eeebf2bf81b857347b388a52584f0606 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 15 Sep 2023 13:34:22 +0200 Subject: [PATCH] chore: fix fetch body not consumed in test (#1782) --- tests/main_test.ts | 1 + tests/route_groups_test.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/main_test.ts b/tests/main_test.ts index 43a1f934..8e2e6932 100644 --- a/tests/main_test.ts +++ b/tests/main_test.ts @@ -863,6 +863,7 @@ Deno.test("PORT environment variable", { await delay(100); const resp = await fetch("http://localhost:" + PORT); + await resp.body?.cancel(); assert(resp); assertEquals(resp.status, Status.OK); diff --git a/tests/route_groups_test.ts b/tests/route_groups_test.ts index b2b29a1e..21999b34 100644 --- a/tests/route_groups_test.ts +++ b/tests/route_groups_test.ts @@ -57,7 +57,7 @@ Deno.test("does not treat files in (_islands) as routes", async () => { async (address) => { const res = await fetch(`${address}/route-groups-islands/invalid`); assertEquals(res.status, 404); - res.body?.cancel(); + await res.body?.cancel(); }, ); }); @@ -68,7 +68,7 @@ Deno.test("does not treat files in (_...) as routes", async () => { async (address) => { const res = await fetch(`${address}/route-groups-islands/sub`); assertEquals(res.status, 404); - res.body?.cancel(); + await res.body?.cancel(); }, ); });