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

Commit

Permalink
fix: add raw node to repo before testing
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Aug 14, 2018
1 parent 10b0120 commit 4d4b889
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/dag.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chai.use(dirtyChai)
const series = require('async/series')
const dagPB = require('ipld-dag-pb')
const DAGNode = dagPB.DAGNode

const CID = require('cids')
const IPFSApi = require('../src')
const f = require('./utils/factory')

Expand Down Expand Up @@ -71,12 +71,17 @@ describe('.dag', function () {
})

it('should callback with error when missing DAG resolver for raw multicodec', (done) => {
// CIDv1 with multicodec = raw
const cid = 'bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy'
ipfs.dag.get(cid, (err, result) => {
expect(result).to.not.exist()
expect(err.message).to.equal('ipfs-api is missing DAG resolver for "raw" multicodec')
done()
ipfs.dag.put(new Buffer([0, 1, 2, 3]), {
// CIDv1 with multicodec = raw
cid: new CID('bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy')
}, (err, cid) => {
expect(err).to.not.exist()

ipfs.dag.get(cid, (err, result) => {
expect(result).to.not.exist()
expect(err.message).to.equal('ipfs-api is missing DAG resolver for "raw" multicodec')
done()
})
})
})
})

0 comments on commit 4d4b889

Please sign in to comment.