-
Notifications
You must be signed in to change notification settings - Fork 398
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
[GnoVM] Add a way to catch emitted events in gno test
#2338
Comments
I still need to scope the whole idea out, but I'm thinking about having a simple helper function in gno/gnovm/stdlibs/testing/context.gno Lines 9 to 21 in ef3b264
This is still WIP, but my idea here is that the user can essentially add a "mock" emitter and capture all emitted events, within the closure passed to Run. |
This issue is stale because it has been open 6 months with no activity. Remove stale label or comment or this will be closed in 3 months. |
Still need this. |
gno test
gno test
Description
We should be able to test events that are being emitted in
gno test
. Is this feasible having in mind the multiple layers that events work on?A suggested approach for the UX could be having a
expectEmit
function somewhere. I like Foundry's approach.It does not really fit into
std
, which makes an even stronger case for moving TestSetXYZ functions out of thestd
package and adding them to a new gno-specifictesting
package (or similar), and having such a function there.@thehowl what do you think?
The text was updated successfully, but these errors were encountered: