title: Testing VueX store
body: <p>I'm trying to test different parts of VueX store. I keep mutations, getters and else in single file (index.js) but somehow it does not work when import that file into test file.
  Here is my VueX:
  Vue.use(Vuex);</p>
  
  <p><code>Index.js</code></p>
  
  <pre><code>import Vue from "vue";
  import Vuex from "vuex";
  
  Vue.use(Vuex);
  
  
  export default new Vuex.Store({
    state: {
      pickedDates:[]
    },
    mutations: {
      mutatePickedDates: (state, payload) =&gt; {
        state.pickedDates = payload;
      },
  })
  </code></pre>
  
  <p>Now in <code>Store.spec.js</code> I want to test it:</p>
  
  <pre><code>import storeConfig from '@/store/index.js'
  
  const store = storeConfig
  
  
  test('check if state is working', () =&gt;{
      const state = {
          pickedDates: []
      }
      const dates = ['1995-01-01', '1995-01-01']
      store.mutations.mutatePickedDates(state, {dates})
      expect(state.pickedDates).toBe(dates)
  
  })
  </code></pre>
  
  <p>But I get error: <code>TypeError: Cannot read property 'mutatePickedDates' of undefined</code> when running test.</p>