Back to Sinon

spy.alwaysCalledOn

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

22.1.0738 B
Original Source

spy.alwaysCalledOn

Returns true, when the fake, spy or stub was always called with object as this.

alwaysCalledOn also accepts a matcher spyCall.alwaysCalledOn(sinon.match(fn)) (see matchers).

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

See Function.prototype.call().

Resetting alwaysCalledOn to default

You can reset alwaysCalledOn in three different ways: