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

Commit

Permalink
Merge pull request #71 from ipfs/fix-for-get
Browse files Browse the repository at this point in the history
Check files.get includes paths/content instead of deepEqual
  • Loading branch information
daviddias authored Sep 9, 2016
2 parents 6468fd2 + 7a913c1 commit 77dad2b
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ module.exports = (common) => {
var paths = files.map((file) => {
return file.path
})
expect(paths).to.deep.equal([
expect(paths).to.include.members([
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP',
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder',
Expand All @@ -401,20 +401,16 @@ module.exports = (common) => {
])

// Check contents
var contents = files.map((file) => {
return file.content ? file.content : null
var contents = files.map(function (file) {
return file.content ? file.content.toString() : null
})
expect(contents).to.deep.equal([
null,
directoryContent['alice.txt'],
null,
null,
null,
directoryContent['files/hello.txt'],
directoryContent['files/ipfs.txt'],
directoryContent['holmes.txt'],
directoryContent['jungle.txt'],
directoryContent['pp.txt']
expect(contents).to.include.members([
directoryContent['alice.txt'].toString(),
directoryContent['files/hello.txt'].toString(),
directoryContent['files/ipfs.txt'].toString(),
directoryContent['holmes.txt'].toString(),
directoryContent['jungle.txt'].toString(),
directoryContent['pp.txt'].toString()
])
done()
}))
Expand Down

0 comments on commit 77dad2b

Please sign in to comment.