title: TypeError: axios.get is not a function?
body: <p>Not sure why I'm getting the following error:</p>
  
  <pre><code>TypeError: axios.get is not a function
  
      4 |
      5 | export const getTotalPayout = async (userId: string) =&gt; {
    &gt; 6 |   const response = await axios.get(`${endpoint}get-total-payout`, { params: userId });
      7 |   return response.data;
      8 | };
      9 |
  </code></pre>
  
  <p><strong>My service:</strong></p>
  
  <pre><code>import * as axios from 'axios';
  
  const endpoint = '/api/pool/';
  
  export const getTotalPayout = async (userId: string) =&gt; {
    const response = await axios.get(`${endpoint}get-total-payout`, { params: userId });
    return response.data;
  };
  </code></pre>
  
  <p><strong>My jest test:</strong></p>
  
  <pre><code>// import mockAxios from 'axios';
  import { getTotalPayout } from './LiquidityPool';
  
  const userId = 'foo';
  
  describe('Pool API', () =&gt; {
    it('getTotalPayout is called and returns the total_payout for the user', async () =&gt; {
      // mockAxios.get.mockImplementationOnce(() =&gt; {
      //   Promise.resolve({
      //     data: {
      //       total_payout: 100.21,
      //     },
      //   });
      // });
  
      const response = await getTotalPayout(userId);
      console.log('response', response);
    });
  });
  </code></pre>
  
  <p><strong>In the src/__mocks__/axios.js I have this:</strong></p>
  
  <pre><code>// tslint:disable-next-line:no-empty
  const mockNoop = () =&gt; new Promise(() =&gt; {});
  
  export default {
    get: jest.fn(() =&gt; Promise.resolve({ data: { total_payout: 100.21 }})),
    default: mockNoop,
    post: mockNoop,
    put: mockNoop,
    delete: mockNoop,
    patch: mockNoop
  };
  </code></pre>