vue-test icon indicating copy to clipboard operation
vue-test copied to clipboard

Add ability to test emitted events

Open asselin opened this issue 7 years ago • 1 comments

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

asselin avatar Mar 02 '17 22:03 asselin

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?

callumacrae avatar Mar 03 '17 09:03 callumacrae