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

Commit

Permalink
fix: fix log.tail by calling add after listening for events (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k authored and Alan Shaw committed Nov 26, 2018
1 parent e79179c commit da35b0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/log.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ describe('.log', function () {
})

it('.log.tail', (done) => {
let i = setInterval(() => {
ipfs.files.add(Buffer.from('just adding some data to generate logs'))
}, 1000)

const req = ipfs.log.tail((err, res) => {
expect(err).to.not.exist()
expect(req).to.exist()

res.once('data', (obj) => {
clearInterval(i)
expect(obj).to.be.an('object')
done()
})
Expand Down

0 comments on commit da35b0f

Please sign in to comment.