From 67bcf60b153353d3a9bf3ef6b84d61bb240146eb Mon Sep 17 00:00:00 2001 From: reasv <7143787+reasv@users.noreply.github.com> Date: Sat, 9 Nov 2019 19:11:08 +0100 Subject: [PATCH] Add dht.provide() test with string CID parameter --- src/dht/provide.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dht/provide.js b/src/dht/provide.js index 11fbe88f0..ca927a2f2 100644 --- a/src/dht/provide.js +++ b/src/dht/provide.js @@ -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()