title: jest function must be a mock or spy
body: <p>I'm writing a test where Im testing the actions in my app. I'm having trouble trying to get the last expect to be called. </p>
  
  <pre class="lang-js prettyprint-override"><code>const pushData = jest.fn(() =&gt; Promise.resolve());
  
  test('anotherAsyncCall is fired to get more info', () =&gt; {
    const store = mockStore({});
    asynCallToGetData = jest.fn(() =&gt; Promise.resolve());
  
    const action = pushData();
    const dispatch = jest.fn();
    const anotherAsyncCall = jest.fn(() =&gt; Promise.resolve());
  
    const expectedActions = [{
      type: 'DATA_RECEIVED_SUCCESS'
    }];
  
    return store.dispatch(action).then(() =&gt; {
      expect(asynCallToGetData).toHaveBeenCalled();
      expect(store.getActions()).toMatch(expectedActions[0].type);
      expect(dispatch(anotherAsyncCall)).toHaveBeenCalled(); //This fails
    });
  });
  </code></pre>
  
  <p>But the message I get after running test is </p>
  
  <pre class="lang-js prettyprint-override"><code>expect(jest.fn())[.not].toHaveBeenCalled()
  
  jest.fn() value must be a mock function or spy.
    Received: undefined here
  </code></pre>