diff options
author | Jimmy Wärting <jimmy@warting.se> | 2021-07-05 15:34:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 15:34:37 +0200 |
commit | 2c0b0e45b72ef1b5d7fa95e1e110d07ddbc720f7 (patch) | |
tree | 3b54a6f1f156f8d105cf41ac290035c8b5f8f1c9 /cli/tests/unit | |
parent | ea87d860beda7cd40eb6857199a00e5ba8700fd2 (diff) |
refactor: asynchronous blob backing store (#10969)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'cli/tests/unit')
-rw-r--r-- | cli/tests/unit/fetch_test.ts | 4 | ||||
-rw-r--r-- | cli/tests/unit/response_test.ts | 3 |
2 files changed, 5 insertions, 2 deletions
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<void> { 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. |