This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ module.exports = (common) => {
97
97
} )
98
98
99
99
it ( 'a BIG buffer with progress enabled' , ( done ) => {
100
- let progCount = 0
100
+ let progCalled = false
101
101
let accumProgress = 0
102
102
function handler ( p ) {
103
- progCount += 1
103
+ progCalled = true
104
104
accumProgress = p
105
105
}
106
106
@@ -112,7 +112,7 @@ module.exports = (common) => {
112
112
expect ( file . hash ) . to . equal ( bigFile . cid )
113
113
expect ( file . path ) . to . equal ( bigFile . cid )
114
114
115
- expect ( progCount ) . to . equal ( 58 )
115
+ expect ( progCalled ) . to . be . true ( )
116
116
expect ( accumProgress ) . to . equal ( bigFile . data . length )
117
117
done ( )
118
118
} )
@@ -223,18 +223,18 @@ module.exports = (common) => {
223
223
return i + ( entry . content ? entry . content . length : 0 )
224
224
} , 0 )
225
225
226
- let progCount = 0
226
+ let progCalled = false
227
227
let accumProgress = 0
228
228
const handler = ( p ) => {
229
- progCount += 1
229
+ progCalled = true
230
230
accumProgress += p
231
231
}
232
232
233
233
ipfs . files . add ( dirs , { progress : handler } , ( err , filesAdded ) => {
234
234
expect ( err ) . to . not . exist ( )
235
235
const root = filesAdded [ filesAdded . length - 1 ]
236
236
237
- expect ( progCount ) . to . equal ( 8 )
237
+ expect ( progCalled ) . to . be . true ( )
238
238
expect ( accumProgress ) . to . be . at . least ( total )
239
239
expect ( root . path ) . to . equal ( 'test-folder' )
240
240
expect ( root . hash ) . to . equal ( directory . cid )
You can’t perform that action at this time.
0 commit comments