title: error in unit test vue.js karma : undefined is not a constructor ()
body: <p>This is my first unit test and I'm getting an error message that couldn't find why I get it in the forums so far.</p>
  
  <p><strong>This is my unit test:</strong></p>
  
  <pre><code>import LoginPage from 'src/pages/Login'
  
  describe('Login.vue', () =&gt; {
  it('mounted is a fuction', () =&gt; {
      expect(typeof LoginPage.mounted).toBe('function')
  })
  })
  </code></pre>
  
  <p><strong>And this is the login page:</strong></p>
  
  <pre><code>&lt;template&gt;
  &lt;div class=""&gt;
      &lt;p v-if="$route.query.redirect"&gt;
         You need to login first.
      &lt;/p&gt;
      &lt;form class="column is-one-third is-offset-one-third" @submit.prevent="login"&gt;
      &lt;div class="control"&gt;
          &lt;input type="email" placeholder="email" v-model="email" class="input"&gt;
      &lt;/div&gt;
      &lt;div class="control"&gt;
          &lt;input type="password" autocomplete="off" placeholder="password" v-model="pass" class="input"&gt;
      &lt;/div&gt;
      &lt;div class="control"&gt;
          &lt;button class="button is-primary" type="submit"&gt;Login&lt;/button&gt;
          &lt;a class="button" href="/signup"&gt;Sign up&lt;/button&gt;
      &lt;/div&gt;
      &lt;p v-if="error" class="help is-danger"&gt;{{ error }}&lt;/p&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
  export default {
  props: ['state'],
  data () {
  return {
      email: '',
      pass: '',
      error: ''
    }
  },
  mounted () {
  if (this.state.auth.currentUser) {
      this.$router.replace(this.$route.query.redirect || '/')
  }
  },
  methods: 
  {
  ....//
  }
  }
  </code></pre>
  
  <p></p>
  
  <p>
  </p>
  
  <p><strong>and this is the error message that I get :</strong></p>
  
  <pre><code>mounted is a fuction
  Login.vue
  undefined is not a constructor (evaluating 'expect((0, _typeof3.default)(_Login2.default.mounted)).toBe('function')')
  webpack:///test/unit/specs/Component.spec.js:5:42 &lt;- index.js:161:65
  </code></pre>
  
  <p><strong>Thanks for your help</strong></p>