summaryrefslogtreecommitdiff
path: root/tests/unit/http_test.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-05-23 10:27:58 +1000
committerGitHub <noreply@github.com>2024-05-23 00:27:58 +0000
commit8a636d0600dc7000d1e12b2fc4f4f46ecd70164a (patch)
treea568fcac6b658e041f15da3b62953a5b812433f6 /tests/unit/http_test.ts
parentf5d0c4b1ea39e34e2e068264f18021a4f7412479 (diff)
feat(ext/fetch): `Request.bytes()` and `Response.bytes()` (#23823)
Closes #23790
Diffstat (limited to 'tests/unit/http_test.ts')
-rw-r--r--tests/unit/http_test.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/http_test.ts b/tests/unit/http_test.ts
index 607f2fc6e..f4fa62fa6 100644
--- a/tests/unit/http_test.ts
+++ b/tests/unit/http_test.ts
@@ -239,7 +239,7 @@ Deno.test(
headers: { "connection": "close" },
});
- await resp.arrayBuffer();
+ await resp.body?.cancel();
await promise;
},
);
@@ -963,7 +963,7 @@ Deno.test(
await respondWith(new Response(f.readable, { status: 200 }));
})();
const resp = await fetch(`http://127.0.0.1:${listenPort}/`);
- const body = await resp.arrayBuffer();
+ const body = await resp.bytes();
assertEquals(body.byteLength, 70 * 1024);
await promise;
httpConn!.close();
@@ -1293,8 +1293,8 @@ Deno.test(
const resp = await fetch(`http://localhost:${listenPort}/`);
assertEquals(resp.status, 200);
- const body = await resp.arrayBuffer();
- assertEquals(new Uint8Array(body), new Uint8Array([128]));
+ const body = await resp.bytes();
+ assertEquals(body, new Uint8Array([128]));
await promise;
httpConn!.close();