-
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
Support expectEvent testing for multiple emits of the same event in a transaction #135
Comments
Also looking for support for this feature. |
Would something like the following work, with a new options argument specifying the times the event should show up. expectEvent(receipt, 'Foo', { arg1: 'bar' }, { times: 2 }); And this function would return the array of found events. |
Not really, events could be emitted many times but with different values |
In that case you can use subsequent calls to expectEvent(receipt, 'Foo', { arg1: 'bar' });
expectEvent(receipt, 'Foo', { arg1: 'quux' }); Otherwise I'm not sure I'm understanding the request. Can someone provide an example of what they would like to write and how they would want it to behave? |
For example: |
|
@SSharshunov In this you would also want to check that the events are emitted in the correct order? |
Does anyone know how to use it for multiple events in one function? |
Support
expectEvent
testing for multiple emits.Currently
expectEvent
will pass for 1 or more emits of the event.Raised by a community member in Telegram:
https://forum.openzeppelin.com/t/test-for-multiple-emits-of-the-same-event-with-expectevent/4106
The text was updated successfully, but these errors were encountered: