Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Merged
Changes from all 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
11 changes: 11 additions & 0 deletions src/dht/provide.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ module.exports = (createCommon, options) => {
})
})
})
it('should provide a CIDv1 string', (done) => {
ipfs.add(Buffer.from('test'), { cidVersion: 1 }, (err, res) => {
if (err) return done(err)

const cid = res[0].hash

ipfs.dht.provide(cid, (err) => {
expect(err).to.not.exist()
done()
})
})
})
it('should error on non CID arg', (done) => {
ipfs.dht.provide({}, (err) => {
expect(err).to.exist()
Expand Down