diff --git a/src/repo/stat.js b/src/repo/stat.js index d313a9998..ef0f8de4d 100644 --- a/src/repo/stat.js +++ b/src/repo/stat.js @@ -41,5 +41,21 @@ module.exports = (createCommon, options) => { expectIsRepo(null, res) }) }) + + it('should get human readable repo stats', async () => { + const res = await ipfs.repo.stat({ human: true }) + + expect(res).to.exist() + expect(res).to.have.a.property('numObjects') + expect(res).to.have.a.property('repoSize') + expect(res).to.have.a.property('repoPath') + expect(res).to.have.a.property('version') + expect(res).to.have.a.property('storageMax') + expect(res.numObjects).to.be.a('number') + expect(res.repoSize).to.match(/\s.?B$/gm) + expect(res.storageMax).to.match(/\s.?B$/gm) + expect(res.repoPath).to.be.a('string') + expect(res.version).to.be.a('string') + }) }) }