I'm wondering how to mock a custom event in VUE which is called from a JavaScript function. I've only found examples of mounting a component and using the wrapper to trigger an event, but in my case, I have no component as I am unit testing the JS file.
JS function:
export default Vue => {
EventContainer.$emit('add', ...);
Vue.prototype.$myVar = myVar;
Vue.$myVar = myVar;
}
EventContainer.js:
export default new Vue()
the function is used as:
myFunction.js
Vue.myVar