Open leohhhn opened 2 weeks ago
I still need to scope the whole idea out, but I'm thinking about having a simple helper function in testing
to replace the ExecContext with one passed in by the user at runtime, which is executed within a closure.
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.
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?