Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 7ff93b8

Browse files
committed
fix: consistent tests across js-ipfs and go-ipfs progress
1 parent c312539 commit 7ff93b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/files.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ module.exports = (common) => {
130130
let progress = 0
131131
const handler = (p) => {
132132
progCount += 1
133-
progress += p
133+
progress = p
134134
}
135135

136-
ipfs.files.add(bigFile, {progress: handler}, (err, res) => {
136+
ipfs.files.add(bigFile, { progress: handler }, (err, res) => {
137137
expect(err).to.not.exist()
138138
expect(res).to.have.length(1)
139139
const file = res[0]
@@ -242,14 +242,14 @@ module.exports = (common) => {
242242
progress += p
243243
}
244244

245-
ipfs.files.add(dirs, {progress: handler}, (err, res) => {
245+
ipfs.files.add(dirs, { progress: handler }, (err, res) => {
246246
expect(err).to.not.exist()
247247
const root = res[res.length - 1]
248248

249249
expect(root.path).to.equal('test-folder')
250250
expect(root.hash).to.equal(expectedRootMultihash)
251251
expect(progCount).to.equal(8)
252-
expect(progress).to.equal(total)
252+
expect(progress).to.be.at.least(total)
253253
done()
254254
})
255255
})

0 commit comments

Comments
 (0)