@@ -15,7 +15,7 @@ describe('ls', function () {
15
15
16
16
let ipfs
17
17
let fc
18
- let folderHash
18
+ let folder
19
19
20
20
before ( function ( done ) {
21
21
this . timeout ( 20 * 1000 ) // slow CI
@@ -28,7 +28,8 @@ describe('ls', function () {
28
28
ipfs . util . addFromFs ( filesPath , { recursive : true } , cb )
29
29
} ,
30
30
( hashes , cb ) => {
31
- folderHash = hashes [ hashes . length - 1 ] . hash
31
+ folder = hashes [ hashes . length - 1 ] . hash
32
+ expect ( folder ) . to . be . eql ( 'QmRNjDeKStKGTQXnJ2NFqeQ9oW23WcpbmvCVrpDHgDg3T6' )
32
33
cb ( )
33
34
}
34
35
] , done )
@@ -39,12 +40,12 @@ describe('ls', function () {
39
40
} )
40
41
41
42
it ( 'should correctly retrieve links' , function ( done ) {
42
- ipfs . ls ( folderHash , ( err , res ) => {
43
+ ipfs . ls ( folder , ( err , res ) => {
43
44
expect ( err ) . to . not . exist
44
45
45
46
expect ( res ) . to . have . a . property ( 'Objects' )
46
47
expect ( res . Objects [ 0 ] ) . to . have . a . property ( 'Links' )
47
- expect ( res . Objects [ 0 ] ) . to . have . property ( 'Hash' )
48
+ expect ( res . Objects [ 0 ] ) . to . have . property ( 'Hash' , 'QmRNjDeKStKGTQXnJ2NFqeQ9oW23WcpbmvCVrpDHgDg3T6' )
48
49
done ( )
49
50
} )
50
51
} )
@@ -67,11 +68,11 @@ describe('ls', function () {
67
68
68
69
describe ( 'promise' , ( ) => {
69
70
it ( 'should correctly retrieve links' , ( ) => {
70
- return ipfs . ls ( folderHash )
71
+ return ipfs . ls ( folder )
71
72
. then ( ( res ) => {
72
73
expect ( res ) . to . have . a . property ( 'Objects' )
73
74
expect ( res . Objects [ 0 ] ) . to . have . a . property ( 'Links' )
74
- expect ( res . Objects [ 0 ] ) . to . have . property ( 'Hash' )
75
+ expect ( res . Objects [ 0 ] ) . to . have . property ( 'Hash' , 'QmRNjDeKStKGTQXnJ2NFqeQ9oW23WcpbmvCVrpDHgDg3T6' )
75
76
} )
76
77
} )
77
78
0 commit comments