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

fix: don't expect ipfs to preserve a leading slash #440

Merged
merged 1 commit into from
Mar 13, 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
4 changes: 2 additions & 2 deletions src/miscellaneous/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = (createCommon, options) => {

// Test resolve turns /ipfs/QmRootHash/path/to/file into /ipfs/QmFileHash
it('should resolve an IPFS path link', (done) => {
const path = '/path/to/testfile.txt'
const path = 'path/to/testfile.txt'
const content = loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core')

ipfs.add([{ path, content }], { wrapWithDirectory: true }, (err, res) => {
Expand All @@ -80,7 +80,7 @@ module.exports = (createCommon, options) => {
const rootHash = res.find(r => r.path === '').hash
const fileHash = res.find(r => r.path === path).hash

ipfs.resolve(`/ipfs/${rootHash}${path}`, (err, path) => {
ipfs.resolve(`/ipfs/${rootHash}/${path}`, (err, path) => {
expect(err).to.not.exist()
expect(path).to.equal(`/ipfs/${fileHash}`)
done()
Expand Down