title: jest function not called after running promise
body: <p>I am trying to test the methods after resolving a promise using Jest and enzyme. My component/functional code:</p>
  
  <pre><code>// Functional Code
  let functionAfterAsync = () =&gt; {
    console.log('functionAfterAsync called');
  }
  const asyncFunction = () =&gt; {
    return new Promise(resolve =&gt; resolve());
  }
  const functionWithAsyncCode = () =&gt; {
    // ... some more code here
    console.log('functionWithAsyncCode');
    asyncFunction().then((res: any) =&gt; {
      functionAfterAsync();
    })
  }
  </code></pre>
  
  <p>My test: </p>
  
  <pre><code>functionAfterAsync = jest.fn();
  // Tests
  describe('&lt;Async Test /&gt;', () =&gt; {
      it('Call function after promise', () =&gt; {
        functionWithAsyncCode();
        expect(functionAfterAsync).toBeCalled();
      })
  });
  </code></pre>
  
  <p>But <code>functionAfterAsync</code> is not getting called and the error I am getting is:
  <code>expect(jest.fn()).toBeCalled()    Expected mock function to have been called.</code></p>
  
  <p>Is there any way to do this. Thanks for the help!!!</p>