We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0cfccc commit bdd3f82Copy full SHA for bdd3f82
docs/release-source/release/stubs.md
@@ -211,6 +211,22 @@ stub.called // false
211
212
*Since `[email protected]`*
213
214
+#### `stub.callsFake(fakeFunction);`
215
+Makes the stub call the provided `fakeFunction` when invoked.
216
+
217
+```javascript
218
+var myObj = {};
219
+myObj.prop = function propFn() {
220
+ return "foo";
221
+};
222
223
+sinon.stub(myObj, prop).callsFake(function fakeFn() {
224
+ return 'bar';
225
+});
226
227
+myObj.prop(); // 'bar'
228
+```
229
230
#### `stub.returns(obj);`
231
Makes the stub return the provided value.
232
0 commit comments