Back to Sinon

spy.alwaysCalledWith

docs/concepts/spies/api/always-called-with.md

22.1.0711 B
Original Source

spy.alwaysCalledWith

Returns true, when the fake, spy or stub was always called with the provided arguments.

Can be used for partial matching, Sinon only checks the provided arguments against actual arguments, so a call that received the provided arguments (in the same spots) and possibly others as well will return true.

<<< ../../../.vitepress/tests/docs/spies/api/always-called-with.test.js

Resetting alwaysCalledWith to default

You can reset alwaysCalledWith in three different ways: