Back to Sinon

stub.yieldsTo

docs/concepts/stubs/api/yields-to.md

22.1.0588 B
Original Source

stub.yieldsTo()

Causes the spy to invoke a callback passed as a property of an object to the spy.

yieldsTo grabs the first matching argument, finds the callback and calls it with the (optional) arguments.

<<< ../../../.vitepress/tests/docs/stubs/api/yields-to.test.js

See also