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

refactor: relax check for undefined property #365

Merged
merged 1 commit into from
Sep 19, 2018
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: 12 additions & 12 deletions js/src/files/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ module.exports = (createCommon, options) => {

ipfs.files.stat(`${testDir}/b`, (err, stat) => {
expect(err).to.not.exist()
expect(stat).to.eql({
expect(stat).to.include({
type: 'file',
blocks: 1,
size: 13,
hash: 'QmcZojhwragQr5qhTeFAmELik623Z21e3jBTpJXoQ9si1T',
cumulativeSize: 71,
withLocality: false,
local: undefined,
sizeLocal: undefined
withLocality: false
})
expect(stat.local).to.be.undefined()
expect(stat.sizeLocal).to.be.undefined()
done()
})
})
Expand All @@ -81,16 +81,16 @@ module.exports = (createCommon, options) => {

ipfs.files.stat(testDir, (err, stat) => {
expect(err).to.not.exist()
expect(stat).to.eql({
expect(stat).to.include({
type: 'directory',
blocks: 1,
size: 0,
hash: 'QmQGn7EvzJZRbhcwHrp4UeMeS56WsLmrey9JhfkymjzXQu',
cumulativeSize: 118,
withLocality: false,
local: undefined,
sizeLocal: undefined
withLocality: false
})
expect(stat.local).to.be.undefined()
expect(stat.sizeLocal).to.be.undefined()
done()
})
})
Expand Down Expand Up @@ -135,16 +135,16 @@ module.exports = (createCommon, options) => {
it('should stat outside of mfs', function (done) {
ipfs.files.stat('/ipfs/' + fixtures.smallFile.cid, (err, stat) => {
expect(err).to.not.exist()
expect(stat).to.eql({
expect(stat).to.include({
type: 'file',
blocks: 0,
size: 12,
hash: fixtures.smallFile.cid,
cumulativeSize: 20,
withLocality: false,
local: undefined,
sizeLocal: undefined
withLocality: false
})
expect(stat.local).to.be.undefined()
expect(stat.sizeLocal).to.be.undefined()
done()
})
})
Expand Down