MtoHaveNthReturnedWith
Bun

method

test.MatchersBuiltin.toHaveNthReturnedWith

n: number,
expected: unknown
): void;

Ensures that a mock function has returned a specific value on the nth invocation. This matcher uses deep equality, like toEqual(), and supports asymmetric matchers.

@param n

The 1-based index of the function call

@param expected

The expected return value