openzeppelin-test-helpers icon indicating copy to clipboard operation
openzeppelin-test-helpers copied to clipboard

Test helpers break compatibility with `bignumber.js` in tests

Open abcoathup opened this issue 6 years ago • 3 comments

PaulRBerg reports on Twitter that Test helpers break compatibility with bignumber.js in their tests (all tests that had "should.be.bignumber.equal" broke)

https://twitter.com/PaulRBerg/status/1163017370434265090?s=20

abcoathup avatar Aug 19 '19 04:08 abcoathup

Our assertions use chai-bn, which works with bn.js, because that's the one that web3 1.0 uses, and the type that truffle v5.0 returns.

I'm not aware of current libraries/frameworks using bignumber.js, we should consider supporting this use case if these exist.

nventuro avatar Aug 20 '19 08:08 nventuro

@PaulRBerg I saw you mentioned you used bignumber.js as a direct dependency: is there a reason to not use bn.js (which is what web3js and truffle support)?

nventuro avatar Oct 08 '19 21:10 nventuro

Well, it's just what I prefer to use. I find the API much better and more intuitive.

And I am aware of at least 2 other projects using bignumber.js instead of bn.js.

PaulRBerg avatar Oct 09 '19 00:10 PaulRBerg