Skip to content
masterclass Buddy

Jest · Matcher

toHaveBeenLastCalledWith

Checks that a Jest mock's most recent call used specific arguments. It also has the alias lastCalledWith.

Last updated

Syntax

expect(mock).toHaveBeenLastCalledWith(arg1, arg2, ...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • expect(value)
  • toHaveBeenCalledWith
  • toHaveBeenNthCalledWith
  • jest.fn()

Source: Aşteptări · Jest. Checked 2026-11-03.