title: Testing React: "Do not await the result of calling act(...) with sync logic"
body: <p>Using react and react-dom 16.9.0</p>
  
  <p>I am getting this warning when I'm testing my react hooks:</p>
  
  <pre><code>console.error node_modules/react-dom/cjs/react-dom-test-utils.development.js:80
  Warning: Do not await the result of calling act(...) with sync logic, it is not a Promise.
  </code></pre>
  
  <p>My test code (using jest with @testing-library/react)</p>
  
  <pre><code>...
  await act( () =&gt; {
    rerender(
      &lt;HookTester
        promise={asyncFunction}
        initialValue={'extra loading...'}
      /&gt;
    );
  });
  
  expect(asyncFunction).toHaveBeenCalledTimes(2);
  ...
  </code></pre>
  
  <p>But if I don't await, then my <code>expect</code>ation would be done too early.</p>