Return empty a empty stream for zero sized blob (#86)

Return empty a empty stream for zero sized blob
This commit is contained in:
Jimmy Wärting
2021-04-29 14:01:01 +02:00
committed by GitHub
parent 483973cf25
commit a8fed4e338
3 changed files with 16 additions and 0 deletions
+6
View File
@@ -172,6 +172,12 @@ test('Reading from the stream created by blobFrom', async t => {
t.is(actual, expected);
});
test('Reading empty blobs', async t => {
const blob = blobFrom('./LICENSE').slice(0, 0);
const actual = await blob.text();
t.is(actual, '');
});
test('Blob-ish class is an instance of Blob', t => {
class File {
stream() {}