title: jest mock multiple axios call
body: <p>I'd like to mock and assert API calls defined in ComponentDidMount.</p>
  
  <pre><code>// App.js    
  async componentDidMount() {
          await this.props.actions.getAnnexList();
          await this.props.actions.getTariffCalendar();
        }
  </code></pre>
  
  <p>I create <strong>mocks</strong> folder with axios.js file.</p>
  
  <pre><code>// __mocks__/axios.js
  export default {
    get: jest.fn(),
    post: jest.fn(),
  };
  </code></pre>
  
  <p>Here is my test suite. I'd like to assert second API call. I put some console.log() in each API action so I know renderComponent() invoke both calls (CDM). I expect to mockAxios be called 2 times but my test failed (it was called 1 time). So my question is how to mock axios to assert multiple calls in one test?</p>
  
  <pre><code>import '@testing-library/jest-dom/extend-expect';
  import '@testing-library/react/cleanup-after-each';
  import React from 'react';
  import { render, fireEvent} from '@testing-library/react';
  import App from '../App';
  
  import store from '../../store/configureStore';
  import { Provider } from 'react-redux';
  import mockAxios from 'axios';
  
  
  /** Render component connected to redux-store */
  const renderComponent = () =&gt;
    render(
      &lt;Provider store={store()}&gt;
        &lt;App /&gt;
      &lt;/Provider&gt;,
    );
  
  describe('App', () =&gt; {
    it('get data on CDM (getAnnexList, getTariffCalendar)', () =&gt; {
      mockAxios.post
        .mockResolvedValueOnce(getAnnexList) // first call
        .mockResolvedValueOnce(getTariffCalendar); // second call
  
      const {} = renderComponent();
  
      expect(mockAxios.post).toBeCalledTimes(1);
      expect(mockAxios.post).toHaveBeenCalledWith(
        'http://localhost/OrderTrancheData/GetAnnexList',
        {
          af: null,
        },
        requestConfig, // mocking some headers etc.
      );
     // assert 2nd call
  
    });
  }
  </code></pre>