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.