Back to Sinon

stub.callsArgWithAsync

docs/concepts/stubs/api/calls-arg-with-async.md

22.1.01.1 KB
Original Source

stub.callsArgWithAsync(index)

Causes the stub to call the argument at the provided index as a callback function, with the argument(s) provided, asynchronously.

<<< ../../../.vitepress/tests/docs/stubs/api/calls-arg-with-async.test.js

Errors

When the argument at the provided index is not available or is not a function, an Error will be thrown.

See also

More information