chaijs / chai

BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
https://chaijs.github.io
MIT License
8.11k stars 694 forks source link

Support big int in approximently #1606

Open koddsson opened 6 months ago

koddsson commented 6 months ago

Added a new assertion property numeric which checks if given variable is of type Number or BigInt. Then used that new assertion to replace a is.a('number') check in the closeTo/approximately assertion.

Also replaced a Math.abs function call which doesn't support BigInt which all adds up to supporting BigInt in closeTo/approximately.

TODO

Follow up

Fixes #1465