title: Using `expect.any(Object)` or `expect.anything()` does not work to match `undefined` in Jest
body: <p>I have the following module which I want to test.</p>
  
  <pre><code>import * as apiUtils from './apiUtils';
  
  export function awardPoints(pointsAwarding) {
    return apiUtils.callApiService("POST", "points", pointsAwarding);
  }
  </code></pre>
  
  <p>And this is my test.</p>
  
  <pre><code>it("should call apiUtils with correct path", () =&gt; {
    //given
    jest.spyOn(apiUtils, 'callApiService');
  
    //when
    pointsAwardingApi.awardPoints();
  
    //then
    expect(apiUtils.callApiService).toBeCalledWith(expect.any(String), 'points', expect.any(Object));
  });
  </code></pre>
  
  <p>When I try to run this test I get the following error.</p>
  
  <p><code>Any&lt;Object&gt; as argument 3, but it was called with undefined.</code></p>
  
  <p>I was expecting that <code>expect.any(Object)</code> would also match <code>undefined</code> but it seems that's not the case.</p>
  
  <p>I also tried with <code>expect.anything()</code> but I get a similar error.</p>
  
  <p>I could simply specify <code>undefined</code> as the third parameter but my test is only intended to verify the second parameter.</p>
  
  <p>Is there a way I can use a matcher that matches any object including <code>undefined</code>?</p>