Vitest · Matcher
toHaveBeenCalledWith
Checks whether a spy or mock was called at least once with specific arguments. Pass the expected arguments to toHaveBeenCalledWith.
Last updated
Syntax
expect(spy).toHaveBeenCalledWith(...args)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toHaveBeenCalledTimestoHaveBeenCalledExactlyOnceWithtoHaveBeenLastCalledWithtoHaveBeenCalledBeforetoHaveBeenCalledAfter