openzeppelin / chai-bn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from asmarques/chai-bignumber
Chai assertions for comparing arbitrary-precision integers using the bn.js library
License: MIT License
This project forked from asmarques/chai-bignumber
Chai assertions for comparing arbitrary-precision integers using the bn.js library
License: MIT License
We could add a default value of BN = require('bn.js')
. What do you think? Coupled with #3 it works out nicely I think.
$ npm i --save-dev @types/chai-bn
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fchai-bn - Not found
Are there any plans to add types?
Chai's members
can be used to test that an array contains certain values, as determined by strict equality or optionally deep equality.
Neither of those is appropriate to test arrays of big numbers (although deep equality works, it isn't ideal). We could maybe make the bignumber
property modify members
to compare values using bignumber equality?
On the other hand, this same issue shows up with many other Chai assertions, like oneOf
...
The isBN
function is implemented with duck typing and it should only use the stricter instanceof
.
Both Chai and BN should be peerDependencies.
TS types were provided by #10
Hoping that someone can submit these to Definitely Types.
I am not sure as to the etiquette of doing this for a Repo to which I am not an approver. So posting here.
We should provide a way to test for almost-equality: this is very useful when dealing with time, where some sort of tolerance is required.
See chai.closeTo
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.