Skip to content
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

Add ability to test emitted events #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

asselin
Copy link
Collaborator

@asselin asselin commented Mar 2, 2017

Before merging, we should probably have a discussion on whether adding another parameter to mount is a good idea...

@callumacrae
Copy link
Owner

callumacrae commented Mar 3, 2017

An alternative could be to turn the returned object into an event emitter instead of adding another argument:

const mounted = mount(Events);
mounted.on('anEvent', spy);
mounted.find('a:first-child').trigger('click');

Wonder if that would be a better idea anyway.

Also, could you test that the event is being passed in as an argument?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants