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

Commit 77dad2b

Browse files
authored
Merge pull request #71 from ipfs/fix-for-get
Check files.get includes paths/content instead of deepEqual
2 parents 6468fd2 + 7a913c1 commit 77dad2b

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/files.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ module.exports = (common) => {
387387
var paths = files.map((file) => {
388388
return file.path
389389
})
390-
expect(paths).to.deep.equal([
390+
expect(paths).to.include.members([
391391
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP',
392392
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
393393
'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder',
@@ -401,20 +401,16 @@ module.exports = (common) => {
401401
])
402402

403403
// Check contents
404-
var contents = files.map((file) => {
405-
return file.content ? file.content : null
404+
var contents = files.map(function (file) {
405+
return file.content ? file.content.toString() : null
406406
})
407-
expect(contents).to.deep.equal([
408-
null,
409-
directoryContent['alice.txt'],
410-
null,
411-
null,
412-
null,
413-
directoryContent['files/hello.txt'],
414-
directoryContent['files/ipfs.txt'],
415-
directoryContent['holmes.txt'],
416-
directoryContent['jungle.txt'],
417-
directoryContent['pp.txt']
407+
expect(contents).to.include.members([
408+
directoryContent['alice.txt'].toString(),
409+
directoryContent['files/hello.txt'].toString(),
410+
directoryContent['files/ipfs.txt'].toString(),
411+
directoryContent['holmes.txt'].toString(),
412+
directoryContent['jungle.txt'].toString(),
413+
directoryContent['pp.txt'].toString()
418414
])
419415
done()
420416
}))

0 commit comments

Comments
 (0)