.toHaveBeenLastCalledWith()

This assertion checks that the last time a mock was called it was with certain arguments.

const mock = jest.fn();
 
mock('foo', 'foo');
mock('foo', 'baz');
 
jestUnexpected(mock).toHaveBeenLastCalledWith('foo', 'bar');
expected
function mockConstructor() {
  return fn.apply(this, arguments);
}
to have been last called with CalledWithSpec({ spec: [ 'foo''bar' ], value2nestedfalse })
 
[
  
'foo',
'baz' 
//
//
//
//
 
should equal 
'bar'
 
baz
bar
]