-
-
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
sinon.restore is deprecated and will be removed from the public API in a future version of sinon. #1390
Comments
Yes, it's missing in the docs. This is an internal utility function and was deprecated in Sinon |
Fixed. It should show up in the migration guides deprecation list shortly. |
awesome! but how to migrate from using |
You can call |
I created a sample migration code below, for anyone who has the same problem
|
@sweetim I had this : afterEach(() => {
clock = sinon.restore();
}); I replaced as in your migration example : beforeEach(() => {
clock = sinon.useFakeTimers();
});
afterEach(() => {
clock.restore();
}); I have now this error : TypeError: Cannot read property 'restore' of undefined |
@kopax we are trying to keep the issue tracker for bugs in the code. this seems like a usage question, in which case you could try our mailing list, Gitter or stackoverflow. Your code example works with Sinon 2.3 and Node 7.4, so your code must be doing something else (for instance restoring the clock before hitting the > clock=sinon.useFakeTimers()
> Date.now()
0
> clock.restore()
> Date.now()
1496995253874 |
@fatso83 I upgraded to sinon |
i have this code with error
AnyModel is a model by mongoosejs using sinon.restore() works, but give me message
i using sinon |
@neetocode
|
This is still an issue. The warning indicates that use of .restore() is the better approach because of impending deprecation, but using .restore() results in |
@jackson-sandland, file an issue if there is something wrong in Sinon 4.x. It needs to include a snippet that shows what is wrong. Your "still a problem" for an issue that was about missing documentation for a deprecated method doesn't really say much. |
I am getting the warning above, after upgrading from Sinon v1.7 to Sinon v2.2
but, i check the document
sinon.restore
is not deprecated, any idea?The text was updated successfully, but these errors were encountered: