This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,29 @@ module.exports = (common) => {
337
337
} )
338
338
} )
339
339
340
+ it ( 'directory' , ( done ) => {
341
+ const hash = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
342
+ ipfs . files . get ( hash , ( err , stream ) => {
343
+ expect ( err ) . to . not . exist
344
+ stream . pipe ( concat ( ( files ) => {
345
+ expect ( files ) . to . be . length ( 8 )
346
+ var paths = files . map ( function ( file ) {
347
+ return file . path
348
+ } )
349
+ expect ( paths ) . to . deep . equal ( [
350
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt"
351
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder"
352
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/holmes.txt"
353
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/jungle.txt"
354
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt"
355
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/empty"
356
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/hello.txt"
357
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/ipfs.txt"
358
+ ] )
359
+ } ) )
360
+ } )
361
+ } )
362
+
340
363
describe ( 'promise' , ( ) => {
341
364
it ( 'with a base58 encoded string' , ( done ) => {
342
365
const hash = 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'
You can’t perform that action at this time.
0 commit comments