-
-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add throwsArg(index) to mocks #1270
Labels
Comments
That seems like a reasonable expansion of the API |
seppevs
added a commit
to seppevs/sinon
that referenced
this issue
Mar 8, 2017
This was requested through sinonjs#1270
mantoni
pushed a commit
that referenced
this issue
May 20, 2017
* add throwsArg(index) to stubs This was requested through #1270 * added additional tests * reviewer comments * added spy.throwArg to mirror stub.throwsArg
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It looks like this was added in 2.3.0, so this can indeed be closed (though that means the wontfix label isn't super accurate). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sinon supports
returnsArg(index)
to easily pass on a value that was passed in, andcallsArg(index)
to callback to an arg that was passed in, but notthrowsArg(index)
to rethrow an error argument that was passed in. This is useful for functions which rethrow a provided error, e.g. when mocking error handlers and hooks.Would you accept a PR for this?
The text was updated successfully, but these errors were encountered: