title: Jest's matcher error: received value must be a function
body: <p>I'm working in the fontend side, and testing my library, I receive an error that I expect but I cannot make an assertion. I have the next code:</p>
  
  <pre class="lang-js prettyprint-override"><code>it('If the username is not entered, I get an error', () =&gt; {
      try {
        new SDK('test', {
          password: 'aaaabbbbcccc',
          key: 'ddddeeefff',
        });
      } catch (error) {
        expect(error).toThrow(
          `Error: The 'username' property has not been entered`
        );
      }
    });
  </code></pre>
  
  <p>As you can see, for the authentication of my library, I need: username, password and key. This is the error that I get:</p>
  
  <p><a href="https://i.stack.imgur.com/jIY1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jIY1l.png" alt="enter image description here"></a></p>
  
  <p>Thank you!</p>