title: How to unit test a typescript Vue Component that uses vuex-class
body: <pre><code>&lt;script lang="ts"&gt;
      import {Component, Vue} from 'vue-property-decorator';
      import {Action, Getter, namespace} from 'vuex-class';
      import {User} from '@/types/userTypes';
  
      const userModule = namespace('user');
  
      @Component({
          name: 'Header'
      })
  
      export default class Header extends Vue {
          data: any;
  
          @userModule.Getter user!: User;
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>The code above is a simple Header component that uses a Getter/namespace for displaying user data.</p>
  
  <p><strong>Question is how to mock the <code>namespace('user', Getter)</code></strong></p>
  
  <p>Running the test I get:</p>
  
  <p><code>[Vue warn]: Error in render: "TypeError: Cannot read property '_modulesNamespaceMap' of undefined"</code></p>
  
  <p>If you have a sample of how to mock this, please share.</p>