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

Commit

Permalink
revert: add test for Object.links with CBOR (#465)
Browse files Browse the repository at this point in the history
This reverts commit ba4f788.
  • Loading branch information
dirkmc authored and Alan Shaw committed May 10, 2019
1 parent d9052c2 commit 4c3d84d
Showing 1 changed file with 0 additions and 37 deletions.
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()
})
})
})
})
})
})
}

0 comments on commit 4c3d84d

Please sign in to comment.