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

Remove test for Object.links with CBOR #465

Merged
merged 1 commit into from
May 10, 2019
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
37 changes: 0 additions & 37 deletions src/object/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,42 +162,5 @@ module.exports = (createCommon, options) => {
})
})
})

it('should get links from CBOR object', (done) => {
const hashes = []
ipfs.add(Buffer.from('test data'), (err, res1) => {
expect(err).to.not.exist()
hashes.push(res1[0].hash)
ipfs.add(Buffer.from('more test data'), (err, res2) => {
hashes.push(res2[0].hash)
expect(err).to.not.exist()
const obj = {
some: 'data',
mylink: { '/': hashes[0] },
myobj: {
anotherLink: { '/': hashes[1] }
}
}
ipfs.dag.put(obj, (err, cid) => {
expect(err).to.not.exist()
ipfs.object.links(cid, (err, links) => {
expect(err).to.not.exist()
expect(links.length).to.eql(2)

// TODO: js-ipfs succeeds but go returns empty strings for link name
// const names = [links[0].name, links[1].name]
// expect(names).includes('mylink')
// expect(names).includes('myobj/anotherLink')

const cids = [links[0].cid.toString(), links[1].cid.toString()]
expect(cids).includes(hashes[0])
expect(cids).includes(hashes[1])

done()
})
})
})
})
})
})
}