diff --git a/docs/release-source/release/stubs.md b/docs/release-source/release/stubs.md index eec7e8712..d25b7ba59 100644 --- a/docs/release-source/release/stubs.md +++ b/docs/release-source/release/stubs.md @@ -226,6 +226,15 @@ Causes the stub to return its this value. Useful for stubbing jQuery-style fluent APIs. +#### `stub.resolves(value);` + +Causes the stub to return a Promise which resolves to the provided value. + +When constructing the Promise, sinon uses the `Promise.resolve` method. You are +responsible for providing a polyfill in environments which do not provide `Promise`. + +*Since `sinon@2.0.0`* + #### `stub.throws();` @@ -242,6 +251,30 @@ Causes the stub to throw an exception of the provided type. Causes the stub to throw the provided exception object. +#### `stub.rejects();` + +Causes the stub to return a Promise which rejects with an exception (`Error`). + +When constructing the Promise, sinon uses the `Promise.reject` method. You are +responsible for providing a polyfill in environments which do not provide `Promise`. + +*Since `sinon@2.0.0`* + + +#### `stub.rejects("TypeError");` + +Causes the stub to return a Promise which rejects with an exception of the provided type. + +*Since `sinon@2.0.0`* + + +#### `stub.rejects(value);` + +Causes the stub to return a Promise which rejects with the provided exception object. + +*Since `sinon@2.0.0`* + + #### `stub.callsArg(index);` Causes the stub to call the argument at the provided index as a callback function. `stub.callsArg(0);` causes the stub to call the first argument as a callback.