Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support big int in approximently #1606

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

koddsson
Copy link
Member

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

  • Write more tests for numeric assertion.

Follow up

  • Look for more places where we should support BigInt.

Fixes #1465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assert.approximately does not work with bigints
1 participant