title: mock dispatch function is not called
body: <p>I am writing a test for async action creator but encountered a problem where it states  <strong>"Expected mock function to have been called"</strong> with:     </p>
  
  <pre><code> [{"type": "GET_LOGIN_SUCCESS", "value": true}]
  </code></pre>
  
  <p>But it was not called.</p>
  
  <p>I am not sure where exactly the problem is. If anyone could help that will be greatly appreciated.
  <img src="https://i.stack.imgur.com/TE7vI.png" alt="console screenshot"></p>
  
  <p>Here's my <strong>actions.js</strong></p>
  
  <pre><code>import { GET_LOGIN_SUCCESS } from './constants'
  
  export const getLoginInfo = () =&gt; {
    return (dispatch, getState, axiosInstance) =&gt; {
      return axiosInstance.get('/api/isLogin.json')
            .then((res) =&gt; {
              dispatch({
                type: GET_LOGIN_SUCCESS,
                value: res.data.data.login
              })
              console.log('finishing dispatch')
            })
      }
  }
  </code></pre>
  
  <p>actions.test.js</p>
  
  <pre><code>import { getLoginInfo } from './actions'
  import { GET_LOGIN_SUCCESS } from './constants'
  
  
  describe('async actions', () =&gt; {
  
      it('dispatches GET_LOGIN_SUCCESS when getting login finishes', () =&gt; {
          const axiosInstance = {
             get: jest.fn(() =&gt; Promise.resolve({ data: { data: {login : true }}}))
          }
          const dispatch = jest.fn()
          getLoginInfo()(dispatch, null, axiosInstance)
          expect(dispatch).toHaveBeenCalledWith({
              type: GET_LOGIN_SUCCESS,
              value: true
          })
      })
    })
  </code></pre>