title: Jest - assert async function throws test fails
body: <p>Got the following failing test case and i'm not sure why:</p>
  
  <p><strong>foo.js</strong></p>
  
  <pre><code>async function throws() {
    throw 'error';
  }
  
  async function foo() {
    try {
      await throws();
    } catch(e) {
      console.error(e);
      throw e;
    }
  }
  </code></pre>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>const foo = require('./foo');
  
  describe('foo', () =&gt; {
    it('should log and rethrow', async () =&gt; {
      await expect(foo()).rejects.toThrow();
    });
  });
  </code></pre>
  
  <p>I expect foo to throw but for some reason it just resolves and the test fails:</p>
  
  <p><code>FAILED foo › should log and rethrow - Received function did not throw</code></p>
  
  <p><a href="https://repl.it/repls/LopsidedDeafeningPattern" rel="noreferrer">Live example</a></p>
  
  <p>Probably missing some basic detail of async await throw behavior.</p>