question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eventEmitted to receive an event object.

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rkaliscommented, May 14, 2019

Just published truffle-assertions@0.9.0 which includes your PR 🎉

1reaction
rkaliscommented, May 14, 2019

I will update the docs and publish a new release either tonight or tomorrow morning JST. Thanks again for contributing!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found