title: How to mock global Vue.js variable in JEST test
body: <p>I have a global property/variable with my app urls:</p>
  
  <pre><code>Vue.prototype.$apiUrls = {
    root: 'http://localhost:8080/',
    api: 'api/v1/'
    // etc.  
  }
  </code></pre>
  
  <p>I use it inside my components as axios request:</p>
  
  <pre><code>axios.get(`${this.$apiUrls.root}${this.$apiUrls.api}/users/`)
  </code></pre>
  
  <p>Now I want to test my component's code, I've mocked <code>axios</code> already, but still I receive an error: </p>
  
  <pre><code>TypeError: Cannot read property '$apiUrls' of undefined
  </code></pre>
  
  <p>I've tried to define/mock this property inside each test and/or in JEST's setup file, like e.g.</p>
  
  <pre><code>global.$apiUrls = {...}
  // or
  Vue.prototype.$apiUrls = {...}
  // or
  Object.defineProperties(Vue.prototype, {$apiUrls: {...}})
  </code></pre>
  
  <p>I've also tried mocking it to <code>window</code> or <code>this</code> (yeah, thats silly), but with no success - I still receive that error - please help.</p>