File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class BlobDataItem {
2323 constructor ( options ) {
2424 this . size = options . size ;
2525 this . path = options . path ;
26- this . start = options . start ;
26+ this . start = options . start || 0 ;
2727 this . mtime = options . mtime ;
2828 }
2929
Original file line number Diff line number Diff line change @@ -163,6 +163,15 @@ test('Reading after modified should fail', async t => {
163163 t . is ( error . name , 'NotReadableError' ) ;
164164} ) ;
165165
166+ test ( 'Reading from the stream created by blobFrom' , async t => {
167+ const blob = blobFrom ( './LICENSE' ) ;
168+ const expected = await fs . promises . readFile ( './LICENSE' , 'utf-8' ) ;
169+
170+ const actual = await getStream ( blob . stream ( ) ) ;
171+
172+ t . is ( actual , expected ) ;
173+ } ) ;
174+
166175test ( 'Blob-ish class is an instance of Blob' , t => {
167176 class File {
168177 stream ( ) { }
You can’t perform that action at this time.
0 commit comments