title: Jest spy the external function issue
body: <p>For some reasone I'm getting this error:</p>
  
  <pre><code>Cannot spy the handleError property because it is not a function; undefined given instead
  </code></pre>
  
  <p>I'm using spy method...</p>
  
  <pre><code>const spyHandleError = jest.spyOn(handleError, 'handleError');
  </code></pre>
  
  <p>...to check if the handleError function was called:</p>
  
  <pre><code>expect(spyHandleError).toHaveBeenCalled();
  </code></pre>
  
  <p>My handleError function looks like that:</p>
  
  <pre><code>import { reduxAction } from '../store/actions/auth';
  
  export const handleError = (status, dispatch) =&gt; {
    if(status === 403) {
      return dispatch(reduxAction());
    }
  };
  </code></pre>
  
  <p>Why I'm getting this error and how can I use spyOn method to test that?</p>