title: Typescript Jest says mock or mockReturnedValue do not exist on types I wish to mock
body: <p>Here's a class I wish to test:</p>
  
  <pre><code>//Request.js
  import axios, {AxiosInstance} from 'axios';
  import config from './config';
  
  const axiosSingleton: AxiosInstance = axios.create({
    baseURL: 'http://localhost:8080',
  });
  
  export default class Request {
    public async get&lt;$ResponseType = any&gt;(url: string): Promise&lt;void&gt; {
      const response = await axiosSingleton.get(url);
      return response.data;
    }
  }
  </code></pre>
  
  <p>when I try testing this by creating a test file, I am not sure how to mock axios. I tried a bunch of ways including - spyOn and automatic mocking. But they don't seem to work. Here's a version of the test file I am not understanding why it doesn't work</p>
  
  <pre><code>// Request.test.js
  import axios from 'axios';
  import Request from './Request';
  
  interface ITestResponseDataType {
    value: string
  }
  
  jest.mock('axios');
  
  describe('Request Tests', () =&gt; {
    it('should call axios get with the right relativeUrl', async () =&gt; {
      const getMock = jest.fn();
  
      axios.create.mockReturnValue({
        get: getMock
      });
  
      getMock.mockResolvedValue({
        value: 'value'
      });
  
      const data = await new Request().get&lt;ITestResponseDataType&gt;('/testUrl');
      expect(getMock.mock.calls.length).toEqual(1);
      expect(data).toEqual({
        value: 'value'
      });
    });
  });
  </code></pre>
  
  <p>The error I get when I try running the test is - </p>
  
  <pre><code> TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
      src/common/api/Request.test.ts:15:18 - error TS2339: Property 'mockReturnValue' does not exist on type '(config?: AxiosRequestConfig | undefined) =&gt; AxiosInstance'.
  
      15     axios.create.mockReturnValue({
  </code></pre>
  
  <p>This error makes sense, because the type defined in axios for axios.create should not allow .mockReturnValue to be called on .create. So how do I tell typescript that jest has gone in and modified it?</p>