From 88e6e5f7caed575a79f135ead6ecc3a17b704929 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Fri, 27 Apr 2018 11:30:09 +0100 Subject: [PATCH] Remove deprecated spy.reset method --- docs/guides/migrating-to-5.0.md | 5 +++++ lib/sinon/spy.js | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/guides/migrating-to-5.0.md b/docs/guides/migrating-to-5.0.md index 233ffcf68..99ca4c946 100644 --- a/docs/guides/migrating-to-5.0.md +++ b/docs/guides/migrating-to-5.0.md @@ -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 `sinon@5.0.0`, 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. diff --git a/lib/sinon/spy.js b/lib/sinon/spy.js index d6963c431..002bced61 100644 --- a/lib/sinon/spy.js +++ b/lib/sinon/spy.js @@ -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"); @@ -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);