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

Check files.get includes paths/content instead of deepEqual #71

Merged
merged 2 commits into from
Sep 9, 2016
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
24 changes: 10 additions & 14 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,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 @@ -396,20 +396,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