title: Mocking a custom event in VUE invoked from a JS function
body: <p>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.</p>
  <p>JS function:</p>
  <pre class="lang-js prettyprint-override"><code>    export default Vue =&gt; {
         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
  </code></pre>