Back to Sinon

stub.yieldsToOnAsync

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

22.1.01.2 KB
Original Source

stub.yieldsToOnAsync(property, context, [arg1, arg2, ...])

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

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

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

See also

More information