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

Js ipfs issue 1145 #241

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 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
26 changes: 23 additions & 3 deletions js/src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,29 @@ module.exports = (common) => {
return ipfs.files.cat(smallFile.cid + '/does-not-exist')
.catch((err) => {
expect(err).to.exist()
expect(err.message).to.oneOf([
'No such file',
'no link named "does-not-exist" under Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'])
expect(err.message).to.contain(
'no link named "does-not-exist" under Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
)
})
})

it('specifies missing directory in a nested link', () => {
return ipfs.files.cat(directory.cid + '/files/missing-dir/does-not-exist')
.catch((err) => {
expect(err).to.exist()
expect(err.message).to.contain(
'no link named "missing-dir" under QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74'
)
})
})

it('specifies missing file in a nested link', () => {
return ipfs.files.cat(directory.cid + '/files/does-not-exist')
.catch((err) => {
expect(err).to.exist()
expect(err.message).to.contain(
'no link named "does-not-exist" under QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74'
)
})
})

Expand Down