eventEmitted to receive an event object.
See original GitHub issueIs your feature request related to a problem?
For most of the time I use eventEmitted filter property to check some props of the emitted event. A more concise way can be just to pass an object to compare it with the event.
Describe the solution you’d like For example I want to check the ERC20 Transfer event. The current form:
truffleAssert.eventEmitted(result, 'TokenCreated', (ev) => {
return ev.from === from && ev.to === to && ev.tokens === tokens
})
Can be changed to
truffleAssert.eventEmitted(result, 'TokenCreated', {from: from, to: to, tokens: tokens})
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
EventEmitter - Angular
Use in components with the @Output directive to emit custom events synchronously or asynchronously, and register handlers for those events by subscribing to ......
Read more >Node.js EventEmitter - TutorialsTeacher
In this pattern, a constructor function returns an EventEmitter object, which was used to emit events inside a function. This EventEmitter object can...
Read more >Node.js - Event Emitter - Tutorialspoint
Many objects in a Node emit events, for example, a net.Server emits an event each time a peer connects to it, an fs.readStream...
Read more >What is the proper use of an EventEmitter? - Stack Overflow
EventEmitter is an angular2 abstraction and its only purpose is to emit events in components. Quoting a comment from Rob Wormald.
Read more >Events | Node.js v19.3.0 Documentation
All objects that emit events are instances of the EventEmitter class. These objects expose an eventEmitter.on() function that allows one or more functions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just published truffle-assertions@0.9.0 which includes your PR 🎉
I will update the docs and publish a new release either tonight or tomorrow morning JST. Thanks again for contributing!