Skip to content
masterclass Buddy

Jest · Matcher

toHaveBeenNthCalledWith

Checks the arguments passed to a Jest mock on a specific call. Call numbering starts at 1.

Last updated

Syntax

expect(mockFn).toHaveBeenNthCalledWith(nthCall, arg1, arg2, ...)

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

Subscribe
  • expect(value)
  • jest.fn()
  • .toHaveBeenCalledWith()
  • .toHaveBeenLastCalledWith()
  • .toHaveBeenCalledTimes()

Source: Expect · Jest. Checked 2026-11-03.