diff --git a/js/src/dag/put.js b/js/src/dag/put.js index 42081a29..f5996fff 100644 --- a/js/src/dag/put.js +++ b/js/src/dag/put.js @@ -100,6 +100,10 @@ module.exports = (createCommon, options) => { ipfs.dag.put(cborNode, done) }) + it('should not fail when calling put without options (promised)', () => { + return ipfs.dag.put(cborNode) + }) + it('should set defaults when calling put without options', (done) => { ipfs.dag.put(cborNode, (err, cid) => { expect(err).to.not.exist() @@ -109,6 +113,14 @@ module.exports = (createCommon, options) => { }) }) + it('should set defaults when calling put without options (promised)', () => { + return ipfs.dag.put(cborNode) + .then((cid) => { + expect(cid.codec).to.equal('dag-cbor') + expect(multihash.decode(cid.multihash).name).to.equal('sha2-256') + }) + }) + it('should override hash algoritm default and resolve with it', (done) => { ipfs.dag.put(cborNode, { format: 'dag-cbor',