@@ -827,13 +827,13 @@ test('drive.download dedup entry', async (t) => {
827827 mirror . swarm . join ( drive . discoveryKey , { server : false , client : true } )
828828 await mirror . swarm . flush ( )
829829
830- const ws = await drive . createWriteStream ( '/entry' , { dedup : true } )
830+ const ws = drive . createWriteStream ( '/entry' , { dedup : true } )
831831 ws . write ( Buffer . alloc ( 1024 ) )
832832 ws . end ( )
833833
834834 await ensureDbLength ( mirror . drive , drive . version )
835835
836- const download = await mirror . drive . download ( '/entry' )
836+ const download = mirror . drive . download ( '/entry' )
837837 await download . done ( )
838838
839839 const mirrorBlobs = await mirror . drive . getBlobs ( )
@@ -843,7 +843,7 @@ test('drive.download dedup entry', async (t) => {
843843 const driveBlobsHash = await driveBlobs . core . treeHash ( )
844844
845845 t . is ( mirrorBlobs . core . contiguousLength , driveBlobs . core . contiguousLength )
846- t . is ( mirrorBlobsHash . toString ( 'hex' ) , driveBlobsHash . toString ( 'hex' ) )
846+ t . alike ( mirrorBlobsHash , driveBlobsHash , 'blob hashes match' )
847847} )
848848
849849test ( 'drive.download folder mixed dedup: true and dedup: false' , async ( t ) => {
@@ -858,7 +858,7 @@ test('drive.download folder mixed dedup: true and dedup: false', async (t) => {
858858 await mirror . swarm . flush ( )
859859
860860 {
861- const ws = await drive . createWriteStream ( '/folder/entry' , { dedup : true } )
861+ const ws = drive . createWriteStream ( '/folder/entry' , { dedup : true } )
862862 ws . write ( Buffer . alloc ( 1024 ) )
863863 ws . end ( )
864864 }
@@ -867,7 +867,7 @@ test('drive.download folder mixed dedup: true and dedup: false', async (t) => {
867867
868868 await ensureDbLength ( mirror . drive , drive . version )
869869
870- const download = await mirror . drive . download ( '/folder' )
870+ const download = mirror . drive . download ( '/folder' )
871871 await download . done ( )
872872
873873 const mirrorBlobs = await mirror . drive . getBlobs ( )
@@ -877,7 +877,7 @@ test('drive.download folder mixed dedup: true and dedup: false', async (t) => {
877877 const driveBlobsHash = await driveBlobs . core . treeHash ( )
878878
879879 t . is ( mirrorBlobs . core . contiguousLength , driveBlobs . core . contiguousLength )
880- t . is ( mirrorBlobsHash . toString ( 'hex' ) , driveBlobsHash . toString ( 'hex' ) )
880+ t . alike ( mirrorBlobsHash , driveBlobsHash , 'blob hashes match' )
881881} )
882882
883883test ( 'drive.has(path)' , async ( t ) => {
@@ -930,7 +930,7 @@ test('drive.has dedup entry is false after getting the blockMap', async (t) => {
930930 mirror . swarm . join ( drive . discoveryKey , { server : false , client : true } )
931931 await mirror . swarm . flush ( )
932932
933- const ws = await drive . createWriteStream ( '/entry' , { dedup : true } )
933+ const ws = drive . createWriteStream ( '/entry' , { dedup : true } )
934934 ws . write ( Buffer . alloc ( 1024 ) )
935935 ws . write ( Buffer . alloc ( 1024 ) )
936936 ws . write ( Buffer . alloc ( 1024 ) )
@@ -942,7 +942,7 @@ test('drive.has dedup entry is false after getting the blockMap', async (t) => {
942942 await mirror . drive . getBlobs ( )
943943 await mirror . drive . blobs . core . get ( 1 ) // get map block
944944
945- t . is ( await mirror . drive . has ( '/entry' ) , false )
945+ t . absent ( await mirror . drive . has ( '/entry' ) , 'has() is false w/ map, but w/o blocks' )
946946} )
947947
948948test ( 'drive.batch() & drive.flush()' , async ( t ) => {
0 commit comments