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

Commit 7c3f8cf

Browse files
StebalienAlan Shaw
authored and
Alan Shaw
committed
test: fix resolve test
1. This is an IPLD path. 2. Resolve really should be resolving up to the last path, not just "failing".
1 parent e161175 commit 7c3f8cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/miscellaneous/resolve.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ module.exports = (createCommon, options) => {
8888
})
8989
})
9090

91-
it('should not resolve an IPFS path non-link', (done) => {
91+
it('should resolve up to the last node', (done) => {
9292
const content = { path: { to: { file: hat() } } }
9393
const options = { format: 'dag-cbor', hashAlg: 'sha2-256' }
9494

9595
ipfs.dag.put(content, options, (err, cid) => {
9696
expect(err).to.not.exist()
9797

98-
const path = `/ipfs/${cid.toBaseEncodedString()}/path/to/file`
99-
ipfs.resolve(path, (err, path) => {
100-
expect(err).to.exist()
101-
expect(err.message).to.equal('found non-link at given path')
98+
const path = `/ipld/${cid.toBaseEncodedString()}/path/to/file`
99+
ipfs.resolve(path, (err, resolved) => {
100+
expect(err).to.not.exist()
101+
expect(resolved).to.be(path)
102102
done()
103103
})
104104
})

0 commit comments

Comments
 (0)