title: Jest mocking: TypeError: axios.get.mockResolvedValue is not a function
body: <p>I have 2 versions of the same code, one works, one throws:</p>
  <pre><code>TypeError: axios.get.mockResolvedValue is not a function
  </code></pre>
  <p>Works:</p>
  <pre><code>const axios = require('axios')
  jest.mock('axios') //&lt;&lt;&lt;------
  
  test('should mock axios', async () =&gt; {
    const resp = {data: {moreData: 'zedata'}}
    axios.get.mockResolvedValue(resp)
    const actualresp = await getAxios()
    expect(actualresp).toEqual({moreData: 'zedata'})
  })
  </code></pre>
  <p>Doesn't:</p>
  <pre><code>const axios = require('axios')
  
  test('should mock axios', async () =&gt; {
    jest.mock('axios') //&lt;&lt;&lt;------
    const resp = {data: {moreData: 'zedata'}}
    axios.get.mockResolvedValue(resp)
    const actualresp = await getAxios()
    expect(actualresp).toEqual({moreData: 'zedata'})
  })
  </code></pre>
  <p>Can someone help me understand why moving <code>jest.mock('axios')</code> inside the testblock (or inside any function, for that matter) results in an error?</p>