@@ -105,7 +105,8 @@ describe('rm', () => {
105105 content : Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] )
106106 } ] , blockstore , {
107107 wrapWithDirectory : true ,
108- shardSplitThresholdBytes
108+ shardSplitThresholdBytes,
109+ shardSplitStrategy : 'links-bytes'
109110 } ) )
110111
111112 if ( importResult == null ) {
@@ -122,19 +123,22 @@ describe('rm', () => {
122123
123124 // create the same shard with unixfs command
124125 await fs . writeBytes ( Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] ) , `${ dirPath } /file-1.txt` , {
125- shardSplitThresholdBytes
126+ shardSplitThresholdBytes,
127+ shardSplitStrategy : 'links-bytes'
126128 } )
127129
128130 await expect ( fs . stat ( dirPath ) ) . to . eventually . have . nested . property ( 'unixfs.type' , 'directory' )
129131
130132 await fs . writeBytes ( Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] ) , `${ dirPath } /file-2.txt` , {
131- shardSplitThresholdBytes
133+ shardSplitThresholdBytes,
134+ shardSplitStrategy : 'links-bytes'
132135 } )
133136
134137 await expect ( fs . stat ( dirPath ) ) . to . eventually . have . nested . property ( 'unixfs.type' , 'hamt-sharded-directory' )
135138
136139 await fs . rm ( `${ dirPath } /file-2.txt` , {
137- shardSplitThresholdBytes
140+ shardSplitThresholdBytes,
141+ shardSplitStrategy : 'links-bytes'
138142 } )
139143
140144 const dirStats = await fs . stat ( dirPath )
@@ -151,7 +155,8 @@ describe('rm', () => {
151155 content : Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] )
152156 } ] , blockstore , {
153157 wrapWithDirectory : true ,
154- shardSplitThresholdBytes
158+ shardSplitThresholdBytes,
159+ shardSplitStrategy : 'links-bytes'
155160 } ) )
156161
157162 if ( importResult == null ) {
@@ -168,19 +173,22 @@ describe('rm', () => {
168173
169174 // create the same shard with unixfs command
170175 await fs . writeBytes ( Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] ) , `${ dirPath } /file-1.txt` , {
171- shardSplitThresholdBytes
176+ shardSplitThresholdBytes,
177+ shardSplitStrategy : 'links-bytes'
172178 } )
173179
174180 await expect ( fs . stat ( dirPath ) ) . to . eventually . have . nested . property ( 'unixfs.type' , 'hamt-sharded-directory' )
175181
176182 await fs . writeBytes ( Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] ) , `${ dirPath } /file-2.txt` , {
177- shardSplitThresholdBytes
183+ shardSplitThresholdBytes,
184+ shardSplitStrategy : 'links-bytes'
178185 } )
179186
180187 await expect ( fs . stat ( dirPath ) ) . to . eventually . have . nested . property ( 'unixfs.type' , 'hamt-sharded-directory' )
181188
182189 await fs . rm ( `${ dirPath } /file-2.txt` , {
183- shardSplitThresholdBytes
190+ shardSplitThresholdBytes,
191+ shardSplitStrategy : 'links-bytes'
184192 } )
185193
186194 const dirStats = await fs . stat ( dirPath )
@@ -204,7 +212,8 @@ describe('rm', () => {
204212
205213 // remove the file that caused the sub-shard to be created and the CID should be the same as the importer
206214 await fs . rm ( `${ dirPath } /${ fileName } ` , {
207- shardSplitThresholdBytes : 1
215+ shardSplitThresholdBytes : 1 ,
216+ shardSplitStrategy : 'links-bytes'
208217 } )
209218
210219 // should still be a shard
@@ -231,7 +240,8 @@ describe('rm', () => {
231240
232241 // remove the file that caused the sub-shard to be created and the CID should be the same as the importer
233242 await fs . rm ( `${ dirPath } /${ fileName } ` , {
234- shardSplitThresholdBytes : 1
243+ shardSplitThresholdBytes : 1 ,
244+ shardSplitStrategy : 'links-bytes'
235245 } )
236246
237247 // should still be a shard
0 commit comments