OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var sinonHelpers = {}; | 5 var sinonHelpers = {}; |
6 | 6 |
7 sinonHelpers.reset = function() { | 7 sinonHelpers.reset = function() { |
8 | 8 |
9 /** | 9 /** |
10 * @param {Object} obj | 10 * @param {Object} obj |
11 * @param {string} method | 11 * @param {string} method |
| 12 * @param {Function=} opt_stubFunction |
12 * @return {sinon.TestStub} | 13 * @return {sinon.TestStub} |
13 * @suppress {reportUnknownTypes} | 14 * @suppress {reportUnknownTypes} |
14 */ | 15 */ |
15 sinon.$setupStub = function(obj, method) { | 16 sinon.$setupStub = function(obj, method, opt_stubFunction) { |
16 sinon.stub(obj, method); | 17 sinon.stub(obj, method, opt_stubFunction); |
17 obj[method].$testStub = /** @type {sinon.TestStub} */ (obj[method]); | 18 obj[method].$testStub = /** @type {sinon.TestStub} */ (obj[method]); |
18 return obj[method].$testStub; | 19 return obj[method].$testStub; |
19 }; | 20 }; |
20 | 21 |
21 }; | 22 }; |
OLD | NEW |