title: Loose match one value in jest.toHaveBeenCalledWith
body: <p>I have an analytics tracker that will only call after 1 second and with an object where the <code>intervalInMilliseconds</code> (duration) value is <strong>not</strong> deterministic.</p>
  
  <p>How can I use <code>jest.toHaveBeenCalledWith</code> to test the object?</p>
  
  <pre class="lang-js prettyprint-override"><code> test('pageStats - publicationPage (will wait 1000ms)', done =&gt; {
    const track = jest.fn()
  
    const expected = new PayloadTiming({
      category: 'PublicationPage',
      action: 'PublicationPage',
      name: 'n/a',
      label: '7',
      intervalInMilliseconds: 1000 // or around
    })
  
    mockInstance.viewState.layoutMode = PSPDFKit.LayoutMode.SINGLE
    const sendPageStats = pageStats({
      instance: mockInstance,
      track,
      remoteId: nappConfig.remoteId
    })
  
    mockInstance.addEventListener('viewState.currentPageIndex.change', sendPageStats)
  
    setTimeout(() =&gt; {
      mockInstance.fire('viewState.currentPageIndex.change', 2)
  
      expect(track).toHaveBeenCalled()
      expect(track).toHaveBeenCalledWith(expected)
  
      done()
    }, 1000)
  
    expect(track).not.toHaveBeenCalled()
  })
  </code></pre>
  
  <p><code>expect(track).toHaveBeenCalledWith(expected)</code> fails with:</p>
  
  <pre><code>Expected mock function to have been called with:
        {"action": "PublicationPage", "category": "PublicationPage", "intervalInMilliseconds": 1000, "label": "7", "name": "n/a"}
      as argument 1, but it was called with
        {"action": "PublicationPage", "category": "PublicationPage", "intervalInMilliseconds": 1001, "label": "7", "name": "n/a"}
  </code></pre>
  
  <p>I have looked at <a href="https://github.com/jest-community/jest-extended" rel="noreferrer">jest-extended</a>
  but I do not see anything useful for my use-case.</p>