title: React tests - UnhandledPromiseRejection
body: <p>I want to test my application with Jest and Enzyme. I'm getting error:</p>
  <pre><code>node:internal/process/promises:246
            triggerUncaughtException(err, true /* fromPromise */);
            ^
  
  [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason &quot;[object Object]&quot;.] {
    code: 'ERR_UNHANDLED_REJECTION'
  }
  </code></pre>
  <p>It is caused by:</p>
  <pre><code>async function checkGet() {
      const fetchedDB = await db.persons.toArray();
      if (fetchedDB.length &gt; 0) {
        setPeople(fetchedDB);
        return;
      } else {
        getPeople();
      }
    }
  </code></pre>
  <p>I tried to change it like that:</p>
  <pre><code> async function checkGet() {
      const fetchedDB = await db.persons.toArray();
      fetchedDB.catch((e) =&gt; {
        console.log(e);
      });
      if (fetchedDB.length &gt; 0) {
        setPeople(fetchedDB);
        return;
      } else {
        getPeople();
      }
    }
  </code></pre>
  <p>And like that:</p>
  <pre><code>  async function checkGet() {
      const fetchedDB = await db.persons.toArray().catch((e) =&gt; {
        console.log(e);
      });
      if (fetchedDB.length &gt; 0) {
        setPeople(fetchedDB);
        return;
      } else {
        getPeople();
      }
    }
  </code></pre>
  <p>But even after adding this, error still exists. I'm using React 17. Is it some sort of bug?</p>