diff options
Diffstat (limited to 'js/fetch_test.ts')
-rw-r--r-- | js/fetch_test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/fetch_test.ts b/js/fetch_test.ts index 2b7f32099..25d8c2ed0 100644 --- a/js/fetch_test.ts +++ b/js/fetch_test.ts @@ -35,3 +35,11 @@ test(async function headersAppend() { } assert(err instanceof TypeError); }); + +testPerm({ net: true }, async function fetchBlob() { + const response = await fetch("http://localhost:4545/package.json"); + const headers = response.headers; + const blob = await response.blob(); + assertEqual(blob.type, headers.get("Content-Type")); + assertEqual(blob.size, Number(headers.get("Content-Length"))); +}); |