From 2c0b0e45b72ef1b5d7fa95e1e110d07ddbc720f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Mon, 5 Jul 2021 15:34:37 +0200 Subject: refactor: asynchronous blob backing store (#10969) Co-authored-by: Luca Casonato --- cli/tests/unit/fetch_test.ts | 4 +++- cli/tests/unit/response_test.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index a84e18367..24a820dba 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -821,7 +821,9 @@ unitTest(function responseRedirect(): void { unitTest(async function responseWithoutBody(): Promise { const response = new Response(); assertEquals(await response.arrayBuffer(), new ArrayBuffer(0)); - assertEquals(await response.blob(), new Blob([])); + const blob = await response.blob(); + assertEquals(blob.size, 0); + assertEquals(await blob.arrayBuffer(), new ArrayBuffer(0)); assertEquals(await response.text(), ""); await assertThrowsAsync(async () => { await response.json(); diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts index 9993eb925..7e444fd83 100644 --- a/cli/tests/unit/response_test.ts +++ b/cli/tests/unit/response_test.ts @@ -34,7 +34,8 @@ unitTest(async function responseBlob() { assert(blobPromise instanceof Promise); const blob = await blobPromise; assert(blob instanceof Blob); - assertEquals(blob, new Blob([new Uint8Array([1, 2, 3])])); + assertEquals(blob.size, 3); + assertEquals(await blob.arrayBuffer(), new Uint8Array([1, 2, 3]).buffer); }); // TODO(lucacasonato): re-enable test once #10002 is fixed. -- cgit v1.2.3