How to check multiple arguments on multiple calls for jest spies?
<p>I have the following function in a React component:</p>

<pre><code>onUploadStart(file, xhr, formData) {
  formData.append('filename', file.name);
  formData.append('mimeType', file.type);
}
</code></pre>

<p>This is my test that at least gets the spy to be called: </p>

<pre><code>const formData = { append: jest.fn() };
const file = { name: 'someFileName', type: 'someMimeType' };
eventHandlers.onUploadStart(file, null, formData);

expect(formData.append).toHaveBeenCalledWith(
  ['mimeType', 'someMimeType'],
  ['fileName', 'someFileName']
);
</code></pre>

<p>However, the assertion is not working:</p>

<pre><code>Expected mock function to have been called with:
 [["mimeType", "someMimeType"], ["fileName", "someFileName"]]
But it was called with:
  ["mimeType", "someMimeType"], ["filename", "someFileName"]
</code></pre>

<p>What is the right way to use <code>toHaveBeenCalledWith</code>?</p>