-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Alias spy.reset to spy.resetHistory #1630
Alias spy.reset to spy.resetHistory #1630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Some minor changed required.
docs/release-source/release/spies.md
Outdated
|
||
Resets the state of a spy. | ||
|
||
|
||
#### `spy.reset()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this. If it's deprecated we don't need to spread knowledge of its existence. Only old code-bases should use this.
lib/sinon/spy.js
Outdated
@@ -413,6 +413,8 @@ function delegateToCalls(method, matchAny, actual, notCalled) { | |||
}; | |||
} | |||
|
|||
spyApi.reset = spyApi.resetHistory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be be wrapped in our deprecation helper. See lib/sinon/util/core/deprecated.js
Thanks for the feedback @fatso83 I'll take a look after the weekend. |
Okay @fatso83 this is ready for re-review - do you think we need a test for the deprecated |
This was fine, no worries. Thanks a lot! |
This has been released with |
Purpose (TL;DR) - mandatory
As per #1446 - deprecates and aliases
spy.reset
in favour ofspy.resetHistory
Background (Problem in detail) - optional
See ticket.
Solution - optional
spy.reset
test to instead usespy.resetHistory
spy.reset
test to make sure alias worksHow to verify - mandatory
npm install
npm test
Checklist for author
npm run lint
passes