-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add dontExpectEvent.inTransaction to test negative cases #98
Comments
Thanks for the suggestion @stephen101! What do you think about the following syntax, so that we keep this helper in the await expectEvent.missing.inTransaction(receipt, 'Foo'); Should this helper also have the option to match the arguments of the event? |
I think |
I'm in need of this to test negative cases too 😊. Is anyone on it? |
No one is working on this yet. @alejoamiras do you want to submit a pull request? |
I like @nventuro's suggestion of expectEvent.not.inTransaction |
Would something like:
Be too nasty ? It would re-use almost all the code. If not, a |
Heh, that implementation definitely works but it's not ideal. An important detail that hasn't been mentioned is whether If everyone agrees with that, then the helper would only check that no events with the given name are present. The implementation of that function is so simple that I wouldn't worry about reusing all of the code of |
I thought it was an awful implementation too 😅. I second that |
I agree with your initial comment that we shouldn't implement the negation of If we add the |
Yeah, I didnt thought we were going for the |
You need to fork this repo and push your branch to your fork. Just submit a draft PR and we can go over the details. |
Created draft PR: #104 |
Agree it shouldn't check arguments. Doesn't make sense to check arguments because you are expecting an event not to happen. |
Closed via #104. |
I would like to assert that certain events don't get emitted under given circumstances.
Suggested syntax:
await dontExpectEvent.inTransaction(truffleReceipt, 'Foo');
The text was updated successfully, but these errors were encountered: