From 25aea44d24e8968180906e1ddd2eae9ed072c7fb Mon Sep 17 00:00:00 2001 From: Tieme van Veen Date: Tue, 27 Dec 2016 12:16:58 +0100 Subject: [PATCH] Fix 810 - Added documentation for sinon.restore() --- docs/_releases/v1.17.6/utils.md | 20 ++++++++++++++++++++ docs/_releases/v2.0.0-pre.4/utils.md | 20 ++++++++++++++++++++ docs/release-source/release/utils.md | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/docs/_releases/v1.17.6/utils.md b/docs/_releases/v1.17.6/utils.md index ab470be56..1a85a7a35 100644 --- a/docs/_releases/v1.17.6/utils.md +++ b/docs/_releases/v1.17.6/utils.md @@ -8,6 +8,26 @@ Sinon.JS has a few utilities used internally in `lib/sinon.js`. Unless the metho ## Utils API +#### `sinon.restore(object);` + +Restores all fake methods of supplied object + +```javascript + sinon.stub(obj); + + // run tests... + + sinon.restore(obj); +``` + +#### `sinon.restore(method);` + +Restores supplied method + +```javascript + sinon.restore(obj.someMethod); +``` + #### `sinon.createStubInstance(constructor);` Creates a new object with the given function as the protoype and stubs all implemented functions. diff --git a/docs/_releases/v2.0.0-pre.4/utils.md b/docs/_releases/v2.0.0-pre.4/utils.md index ab470be56..1a85a7a35 100644 --- a/docs/_releases/v2.0.0-pre.4/utils.md +++ b/docs/_releases/v2.0.0-pre.4/utils.md @@ -8,6 +8,26 @@ Sinon.JS has a few utilities used internally in `lib/sinon.js`. Unless the metho ## Utils API +#### `sinon.restore(object);` + +Restores all fake methods of supplied object + +```javascript + sinon.stub(obj); + + // run tests... + + sinon.restore(obj); +``` + +#### `sinon.restore(method);` + +Restores supplied method + +```javascript + sinon.restore(obj.someMethod); +``` + #### `sinon.createStubInstance(constructor);` Creates a new object with the given function as the protoype and stubs all implemented functions. diff --git a/docs/release-source/release/utils.md b/docs/release-source/release/utils.md index fad3fb207..a65be1b96 100644 --- a/docs/release-source/release/utils.md +++ b/docs/release-source/release/utils.md @@ -8,6 +8,26 @@ Sinon.JS has a few utilities used internally in `lib/sinon.js`. Unless the metho ## Utils API +#### `sinon.restore(object);` + +Restores all fake methods of supplied object + +```javascript + sinon.stub(obj); + + // run tests... + + sinon.restore(obj); +``` + +#### `sinon.restore(method);` + +Restores supplied method + +```javascript + sinon.restore(obj.someMethod); +``` + #### `sinon.createStubInstance(constructor);` Creates a new object with the given function as the protoype and stubs all implemented functions.