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

fix: make tests consistent across js-ipfs/go-ipfs #158

Merged
merged 4 commits into from
Oct 18, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ module.exports = (common) => {
let progress = 0
const handler = (p) => {
progCount += 1
progress += p
progress = p
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to accumProgress so that it is clear what it is measuring

}

ipfs.files.add(bigFile, {progress: handler}, (err, res) => {
ipfs.files.add(bigFile, { progress: handler }, (err, res) => {
expect(err).to.not.exist()
expect(res).to.have.length(1)
const file = res[0]
Expand Down Expand Up @@ -220,14 +220,14 @@ module.exports = (common) => {
progress += p
}

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

expect(root.path).to.equal('test-folder')
expect(root.hash).to.equal(expectedRootMultihash)
expect(progCount).to.equal(8)
expect(progress).to.equal(total)
expect(progress).to.be.at.least(total)
done()
})
})
Expand Down