Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Fix new tests to check for right value
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Starr committed Apr 27, 2018
1 parent 54beacb commit 21ccc0f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/ipld-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ describe('IPLD Resolver for dag-cbor + dag-pb', () => {
})

it('resolve through different formats', (done) => {
resolver.get(cidCbor, 'pb/Data', (err, result) => {
resolver.get(cidCbor, 'pb/Data', (err, results) => {
expect(err).to.not.exist()
expect(result.length).to.eq(2)
dagCBOR.util.cid(result[0].value['/'], (cid) => expect(cid).to.eql(cidPb))
expect(result[1].value).to.eql(Buffer.from('I am inside a Protobuf'))
expect(results.length).to.eq(2)
expect(results[0].value['/']).to.eql(cidPb.multihash)
expect(results[1].value).to.eql(Buffer.from('I am inside a Protobuf'))
done()
})
})
Expand All @@ -75,17 +75,17 @@ describe('IPLD Resolver for dag-cbor + dag-pb', () => {
pull.collect((err, results) => {
expect(err).to.not.exist()
expect(results.length).to.eq(2)
dagCBOR.util.cid(results[0].value['/'], (cid) => expect(cid).to.eql(cidPb))
expect(results[0].value['/']).to.eql(cidPb.multihash)
expect(results[1].value).to.eql(Buffer.from('I am inside a Protobuf'))
done()
}))
})

it('resolve honors onlyNode option', (done) => {
resolver.get(cidCbor, 'pb/Data', { onlyNode: true }, (err, result) => {
resolver.get(cidCbor, 'pb/Data', { onlyNode: true }, (err, results) => {
expect(err).to.not.exist()
expect(result.length).to.eq(1)
expect(result[0].value).to.eql(Buffer.from('I am inside a Protobuf'))
expect(results.length).to.eq(1)
expect(results[0].value).to.eql(Buffer.from('I am inside a Protobuf'))
done()
})
})
Expand Down

0 comments on commit 21ccc0f

Please sign in to comment.