title: Mock mounted hook Jest testing unit
body: <p>I am doing some unit testing for components. However, in some components, I have something running on the <code>mounted</code> hook that is making my test fail.
  I have managed to mock the methods that I do not need. However, I was wondering if there is a workaround mocking the <code>mounted</code> hook itself.</p>
  
  <p><strong>@/components/attendeesList.vue</strong></p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;span&gt; This is a test &lt;/span&gt; 
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>&lt;script&gt;
  methods: {
      testMethod: function() {
          // Whatever is in here I have managed to mock it
      }
  },
  
  mounted: {
      this.testMethod();
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Test.spec.js</strong></p>
  
  <pre><code>import { mount, shallowMount } from '@vue/test-utils'
  import test from '@/components/attendeesList.vue'
  
  describe('mocks a method', () =&gt; {    
    test('is a Vue instance', () =&gt; {
    const wrapper = shallowMount(attendeesList, {
      testMethod:jest.fn(),
    })
    expect(wrapper.isVueInstance()).toBeTruthy()
  })
  </code></pre>