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 @@ -334,6 +334,29 @@ module.exports = (common) => {
334
334
} )
335
335
} )
336
336
337
+ it ( 'directory' , ( done ) => {
338
+ const hash = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
339
+ ipfs . files . get ( hash , ( err , stream ) => {
340
+ expect ( err ) . to . not . exist
341
+ stream . pipe ( concat ( ( files ) => {
342
+ expect ( files ) . to . be . length ( 8 )
343
+ var paths = files . map ( function ( file ) {
344
+ return file . path
345
+ } )
346
+ expect ( paths ) . to . deep . equal ( [
347
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt"
348
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder"
349
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/holmes.txt"
350
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/jungle.txt"
351
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt"
352
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/empty"
353
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/hello.txt"
354
+ "QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files/ipfs.txt"
355
+ ] )
356
+ } ) )
357
+ } )
358
+ } )
359
+
337
360
describe ( 'promise' , ( ) => {
338
361
it ( 'with a base58 encoded string' , ( done ) => {
339
362
const hash = 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'
You can’t perform that action at this time.
0 commit comments