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

Create global chai setup #572

Open
RiccardoBiosas opened this issue May 16, 2022 · 1 comment
Open

Create global chai setup #572

RiccardoBiosas opened this issue May 16, 2022 · 1 comment

Comments

@RiccardoBiosas
Copy link
Contributor

RiccardoBiosas commented May 16, 2022

Context
Currently chai is directly imported on each test file, where it is then attached to the ethereum-waffle's solidity chai matcher (i.e.: here). Furthermore, there are occurrences where it uses different assertion styles (i.e.: here and here).

TODO

  • Create a global chai setup in its own separate file
  • Replace ethereum-waffle with chai-ethers: the ethereum-waffle library is much broader in its scope than chai-ethers which, similarly to ethereum-waffle's solidity, only provides chai matchers to deal with ethereum testing. Removing ethereum-waffle will prevent potential misuse in the future should anyone use it for anything else other than attaching its matchers to chai.
  • Enforce a consistent assertion style: since it seems that the most used construct is expect, we should remove all the occurrences of assert
  • add expectThrow and expectFail as custom assertions in the custom chai setup

Related to #566

@yondonfu
Copy link
Member

TBD on whether we want to remove ethereum-waffle - might not be a big deal to leave it. The person working on this should make sure to consider this and get feedback before making a decision.

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

No branches or pull requests

2 participants