Back to Sinon

stub.yieldsToOn

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

22.1.0806 B
Original Source

stub.yieldsToOn()

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

yieldsToOn grabs the first matching argument, finds the callback and calls it, passing the this context and any (optional) arguments.

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

See also

More information