title: Mock.mockImplementation() not working
body: <p>I have a service class</p>
  
  <p>Service.js</p>
  
  <pre><code>class Service {
  }
  export default new Service();
  </code></pre>
  
  <p>And I am trying to provide a mock implementation for this. If I use something like this:</p>
  
  <pre><code>jest.mock('./Service', () =&gt; { ... my mock stuff });
  </code></pre>
  
  <p>It works fine, however I'm not able to access any variables declared outside of the mock, which is a bit limiting as I'd like to reconfigure what the mock returns, etc. </p>
  
  <p>I tried this (inspired by this other StackOverflow article: <a href="https://stackoverflow.com/questions/44649699/service-mocked-with-jest-causes-the-module-factory-of-jest-mock-is-not-allowe">Service mocked with Jest causes &quot;The module factory of jest.mock() is not allowed to reference any out-of-scope variables&quot; error</a>)</p>
  
  <pre><code>import service from './Service';
  
  jest.mock('./Service', () =&gt; jest.fn);
  
  service.mockImplementation(() =&gt; {
      return { ... mock stuff }
  );
  </code></pre>
  
  <p>Unfortunately when I am trying to run this, I get the below error:</p>
  
  <pre><code>TypeError: _Service2.default.mockImplementation is not a function
  </code></pre>