Skip to content

Commit

Permalink
Remove deprecated spy.reset method
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Apr 30, 2018
1 parent f133b6a commit 88e6e5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/guides/migrating-to-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ breadcrumb: migrating to 5.0
As with all `MAJOR` releases in [`semver`](http://semver.org/), there are breaking changes in `sinon@5`.
This guide will walk you through those changes.

## `spy.reset()` is removed, use `spy.resetHistory()`

In a previous version we deprecated and aliased `spy.reset` in favour of using `spy.resetHistory`. `spy.reset` has now been removed, you should use `spy.resetHistory`.


## `sinon` is now a (default) sandbox

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.
Expand Down
3 changes: 0 additions & 3 deletions lib/sinon/spy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var createBehavior = require("./behavior").create;
var extend = require("./util/core/extend");
var deprecated = require("./util/core/deprecated");
var functionName = require("./util/core/function-name");
var functionToString = require("./util/core/function-to-string");
var getPropertyDescriptor = require("./util/core/get-property-descriptor");
Expand Down Expand Up @@ -428,8 +427,6 @@ function delegateToCalls(method, matchAny, actual, returnsValues, notCalled, tot
};
}

spyApi.reset = deprecated.wrap(spyApi.resetHistory, deprecated.defaultMsg("reset"));

delegateToCalls("calledOn", true);
delegateToCalls("alwaysCalledOn", false, "calledOn");
delegateToCalls("calledWith", true);
Expand Down

0 comments on commit 88e6e5f

Please sign in to comment.