Back to Sinon

stub.yieldsToAsync

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

22.1.01006 B
Original Source

stub.yieldsToAsync()

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

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

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

See also

More information