chore: fix fetch body not consumed in test (#1782)
This commit is contained in:
@@ -863,6 +863,7 @@ Deno.test("PORT environment variable", {
|
|||||||
await delay(100);
|
await delay(100);
|
||||||
|
|
||||||
const resp = await fetch("http://localhost:" + PORT);
|
const resp = await fetch("http://localhost:" + PORT);
|
||||||
|
await resp.body?.cancel();
|
||||||
assert(resp);
|
assert(resp);
|
||||||
assertEquals(resp.status, Status.OK);
|
assertEquals(resp.status, Status.OK);
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Deno.test("does not treat files in (_islands) as routes", async () => {
|
|||||||
async (address) => {
|
async (address) => {
|
||||||
const res = await fetch(`${address}/route-groups-islands/invalid`);
|
const res = await fetch(`${address}/route-groups-islands/invalid`);
|
||||||
assertEquals(res.status, 404);
|
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) => {
|
async (address) => {
|
||||||
const res = await fetch(`${address}/route-groups-islands/sub`);
|
const res = await fetch(`${address}/route-groups-islands/sub`);
|
||||||
assertEquals(res.status, 404);
|
assertEquals(res.status, 404);
|
||||||
res.body?.cancel();
|
await res.body?.cancel();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user