Add 'shouldFailWithMessage' test helper
See original GitHub issue🧐 Motivation Exactly as described in issue’s title 😃.
📝 Details First of all, thanks for prividing this awesome framework. It makes creating secure smart contracts actually possible!
I’ve been importing functions from openzeppelin-solidity/tests/helpers
to use in my own tests for a couple of weeks. They work perfectly so there’s no need to craft my own. Helpers in shouldFail.js
have been particularly useful.
Aside, from the canned shouldFail[reverting,throwing,outOfGas]
helpers, I think the generic shouldFailWithMessage
is flexible and can be used to check for different failure reasons. However, it is not exported by the module.
I suggest exporting it so it could be used externally when neither of reverting, throwing, outOfGas
fill the bill.
I will follow up with a one liner PR to introduce that change.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Working on exporting test helper + adding unit tests for the helper itself.
This was added to https://github.com/OpenZeppelin/openzeppelin-test-helpers