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

Testing arrays of big numbers #5

Open
frangio opened this issue Jan 2, 2019 · 4 comments
Open

Testing arrays of big numbers #5

frangio opened this issue Jan 2, 2019 · 4 comments
Labels
good first issue Good for newcomers

Comments

@frangio
Copy link
Collaborator

frangio commented Jan 2, 2019

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...

@nventuro
Copy link

nventuro commented Jan 2, 2019

Hmm, this makes a lot of sense. It's also related to OpenZeppelin/openzeppelin-test-helpers#1

Regarding oneOf and friends, just overriding members and making it clear in the documentation that it is the only overridden method seems fine to me.

@EvolveArt
Copy link

I feel like this issue hasn't been fixed yet.

Is there any workaround ?

@frangio
Copy link
Collaborator Author

frangio commented Nov 14, 2021

The workaround is to do the appropriate array operation manually instead of using Chai's helpers.

@bet8888
Copy link

bet8888 commented Jan 18, 2022

It would be better if there was this feature. Hope to add this feature.

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

No branches or pull requests

4 participants