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

Commit 91a72e3

Browse files
reasvAlan Shaw
authored and
Alan Shaw
committed
test: add dht.provide() test with string CID parameter (#555)
1 parent b4c3ce6 commit 91a72e3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/dht/provide.js

+11
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,18 @@ module.exports = (createCommon, options) => {
8888
})
8989
})
9090
})
91+
it('should provide a CIDv1 string', (done) => {
92+
ipfs.add(Buffer.from('test'), { cidVersion: 1 }, (err, res) => {
93+
if (err) return done(err)
94+
95+
const cid = res[0].hash
9196

97+
ipfs.dht.provide(cid, (err) => {
98+
expect(err).to.not.exist()
99+
done()
100+
})
101+
})
102+
})
92103
it('should error on non CID arg', (done) => {
93104
ipfs.dht.provide({}, (err) => {
94105
expect(err).to.exist()

0 commit comments

Comments
 (0)