title: How to test the type of a thrown exception in Jest
body: <p>I'm working with some code where I need to test the type of an exception thrown by a function (is it TypeError, ReferenceError, etc.?).</p>
  <p>My current testing framework is AVA and I can test it as a second argument <code>t.throws</code> method, like here:</p>
  <pre class="lang-js prettyprint-override"><code>it('should throw Error with message \'UNKNOWN ERROR\' when no params were passed', (t) =&gt; {
    const error = t.throws(() =&gt; {
      throwError();
    }, TypeError);
  
    t.is(error.message, 'UNKNOWN ERROR');
  });
  </code></pre>
  <p>I started rewriting my tests in Jest and couldn't find how to easily do that. Is it even possible?</p>