mirror of
https://github.com/denoland/deno.git
synced 2024-12-11 18:17:48 -05:00
15 lines
No EOL
442 B
TypeScript
15 lines
No EOL
442 B
TypeScript
// This file should be excluded from formatting
|
|
Deno.test(
|
|
{ perms: { net: true } },
|
|
async function fetchBodyUsedCancelStream() {
|
|
const response = await fetch(
|
|
"http://localhost:4545/assets/fixture.json",
|
|
);
|
|
assert(response.body !== null);
|
|
|
|
assertEquals(response.bodyUsed, false);
|
|
const promise = response.body.cancel();
|
|
assertEquals(response.bodyUsed, true);
|
|
await promise;
|
|
},
|
|
); |