Skip to content
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

Document updates (fixes?) to (calls|resolves|returns|throws)Arg #1854

Closed
fearphage opened this issue Jul 6, 2018 · 4 comments
Closed

Document updates (fixes?) to (calls|resolves|returns|throws)Arg #1854

fearphage opened this issue Jul 6, 2018 · 4 comments

Comments

@fearphage
Copy link
Member

In 6.1.2, the way calls to callsarg, resolvesArg, returnsArg, and throwsArg handled not enough parameters changed/were fixed (via #1848).

Example

const stub = sinon.stub().returnsArg(5);
const result = stub('not', 'enough', 'args');  // the outcome of this line changed

Previously result would be set to undefined since there is no argument at the 5th index. At 6.1.2, this functionality changed into a TypeError being thrown since there aren't enough arguments to satisfy the request. Keep in mind that callsArg would have always thrown a TypeError here since undefined is not a function. However the error message changed to match the others.

These changes should be documented.

Note: resolvesArg was added in 6.1.1 and always functioned this way. It didn't change like the others, but it also needs to be documented.

@stale
Copy link

stale bot commented Sep 4, 2018

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.

@stale stale bot added the stale label Sep 4, 2018
@fearphage
Copy link
Member Author

fearphage commented Sep 4, 2018

This was fixed in #1860 .

@fearphage

This comment has been minimized.

@fearphage
Copy link
Member Author

The comment above is hidden.

franck-romano pushed a commit to franck-romano/sinon that referenced this issue Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant