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

test(dag): add test to verify put API overrides hash algorithm #323

Merged
merged 1 commit into from
Jul 5, 2018
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
12 changes: 12 additions & 0 deletions js/src/dag/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ module.exports = (createCommon, options) => {
})
})

it('should override hash algoritm default and resolve with it', (done) => {
ipfs.dag.put(cborNode, {
format: 'dag-cbor',
hashAlg: 'sha3-512'
}, (err, cid) => {
expect(err).to.not.exist()
expect(cid.codec).to.equal('dag-cbor')
expect(multihash.decode(cid.multihash).name).to.equal('sha3-512')
done()
})
})

it.skip('should put by passing the cid instead of format and hashAlg', (done) => {})

// TODO it.skip('Promises support', (done) => {})
Expand Down