-
Notifications
You must be signed in to change notification settings - Fork 109
test: add human readable repo stats test #554
Conversation
Can I get a second review here, please? @alanshaw @hugomrdias |
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yap, sorry, the modifiers are not needed @alanshaw. Furthermore, I'll update the expression, I'll make it more specific.
I wouldn't have asked for a second review if the test was not passing locally. You can see it passing here:
This is the res
object
{
...
repoSize: '30.1 KB'
storageMax: '9.01 PB'
}
What do you think about this regex? Does this one seem better? It would match the whole string instead of just the units.
/^[\d]+(\.[\d]+)?\s[KMGTP]?B$/
Considering the res
object (mentioned above), this new regex will match:
and
This can be closed now right @PedroMiguelSS? |
Closed in favor of ipfs/js-ipfs#2630. |
Add human-readable repo stats test.