Back to Sinon

stub.resolvesArg

docs/concepts/stubs/api/resolves-arg.md

22.1.0466 B
Original Source

stub.resolvesArg(index)

Causes the stub to return a Promise, which resolves to the argument at the provided index.

stub.resolvesArg(0); causes the stub to return a Promise, which resolves to the first argument.

If the argument at the provided index is not available, a TypeError will be thrown.

<<< ../../../.vitepress/tests/docs/stubs/api/resolves-arg.test.js