summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/fetch_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 012ce7b34..4bdb54d9e 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -738,6 +738,16 @@ unitTest(function responseRedirect(): void {
assertEquals(redir.type, "default");
});
+unitTest(async function responseWithoutBody(): Promise<void> {
+ const response = new Response();
+ assertEquals(await response.arrayBuffer(), new ArrayBuffer(0));
+ assertEquals(await response.blob(), new Blob([]));
+ assertEquals(await response.text(), "");
+ await assertThrowsAsync(async () => {
+ await response.json();
+ });
+});
+
unitTest({ perms: { net: true } }, async function fetchBodyReadTwice(): Promise<
void
> {