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
chore: migrate away from Node's EventEmitter #5979
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % the TODO you outlined
// Two now because we added the handler back. | ||
expect(handler.callCount).toBe(2); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a user reported a bug in 3.2 where this code didn't work. I don't think it was a bug in Mitt, but I wanted to add a test that explicitly listened to an event, stopped, and then started again just to make sure. It's a useful test to have IMO.
8cfafee
to
410412b
Compare
And link to our event emitter instead. This ensures that we don't send anyone erroneously to the NodeJS docs.
This PR re-introduces Mitt (that was released in v3.2 and reverted in v3.3).
The majority of EventEmitter methods are re-implemented in Puppeteer and we will release this as a major version accompanied by release notes that document exactly which methods have been removed to help users migrate.