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

Commit 4c3f965

Browse files
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 f571feb commit 4c3f965

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

js/src/miscellaneous/resolve.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ module.exports = (createCommon, options) => {
7272
})
7373
})
7474

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

7979
ipfs.dag.put(content, options, (err, cid) => {
8080
expect(err).to.not.exist()
8181

82-
const path = `/ipfs/${cid.toBaseEncodedString()}/path/to/file`
83-
ipfs.resolve(path, (err, path) => {
84-
expect(err).to.exist()
85-
expect(err.message).to.equal('found non-link at given path')
82+
const path = `/ipld/${cid.toBaseEncodedString()}/path/to/file`
83+
ipfs.resolve(path, (err, resolved) => {
84+
expect(err).to.not.exist()
85+
expect(resolved).to.be(path)
8686
done()
8787
})
8888
})

0 commit comments

Comments
 (0)