title: waitFor won't run the callback again
body: <p>I tried to test what <a href="https://testing-library.com/docs/dom-testing-library/api-async#waitfor" rel="nofollow noreferrer">the documentation</a> says about waitFor, but when I use a promise the callback won't run again even though it is rejected.</p>
  <blockquote>
  <p>waitFor may run the callback a variable number of times.</p>
  <p>This can be useful if you have a unit test that mocks API calls and
  you need to wait for your mock promises to all resolve.</p>
  <p>If you return a promise in the waitFor callback (either explicitly or
  implicitly with async syntax), then the waitFor utility will not call
  your callback again until that promise rejects. This allows you to
  waitFor things that must be checked asynchronously.</p>
  </blockquote>
  <pre><code>import { waitFor } from &quot;@testing-library/react&quot;;
  import request, { asyncFunc } from &quot;./request&quot;;
  
  jest.mock(&quot;./request&quot;);
  
  function asyncFunc() {
    return new Promise((res, rej) =&gt; {
      setTimeout(() =&gt; {
        rej(4);
      }, 50);
    });
  }
  
  test.only(&quot;waits 1 second before ending the game&quot;, async () =&gt; {
    await waitFor(() =&gt; {
      return console.log(&quot;heyy&quot;), asyncFunc();
    });
  });
  </code></pre>