title: Mocking a module imported in a vue component with Jest
body: <p>I'm having some issues processing the <a href="https://jestjs.io/docs/en/es6-class-mocks#automatic-mock" rel="noreferrer">documentation of Jest</a>, because I expected this code to work:</p>
  
  <pre><code>import Vue from 'vue';
  import Router from '@/router/index';
  import OrdersService from '@/services/orders.service';
  
  jest.mock('@/services/orders.service');
  
  describe('OrdersItem.vue', () =&gt; {
    beforeEach(() =&gt; {
      // mockClear does not exist
      OrdersService.mockClear();
    });
  
    it('should render expected list contents', () =&gt; {
      // Orders.mock is undefined 
      OrdersService.getAll.mockResolvedValue([ ... ]);
      // ...
  </code></pre>
  
  <p>However it does not. It fails as-if <code>OrdersService</code> was never mocked. I've also tried stuff like:</p>
  
  <pre><code>jest.mock('@/services/orders.service', () =&gt; jest.fn());
  jest.mock('@/services/orders.service', () =&gt; { getAll: jest.fn() });
  </code></pre>
  
  <p>First one replaces the whole service with a mock function (I'd like to achieve that automatic mocking functionality mentioned in the docs, where all the methods from the original are auto-replaced with mock fn).
  Second one fails same way as the <code>.mock</code> call with just the module path.</p>
  
  <p>What am I doing wrong here and why?</p>
  
  <p><code>orders.service</code> skeleton:</p>
  
  <pre><code>import axios from 'axios';
  import config from '../config/config.json';
  import Order from '../models/order';
  
  class OrdersService {
    constructor(httpClient) {
      this.httpClient = httpClient;
    }
  
    getAll() {
        // ...
    }
  }
  export default new OrdersService(axios);
  </code></pre>