* Merges #1716 from @elliot-nelson
This commit is contained in:
Pivotal
2019-08-29 13:48:58 -07:00
committed by Steve Gravrock
6 changed files with 186 additions and 8 deletions

View File

@@ -12,7 +12,13 @@ getJasmineRequireObj().Spy = function(j$) {
* @constructor
* @name Spy
*/
function Spy(name, originalFn, customStrategies, getPromise) {
function Spy(
name,
originalFn,
customStrategies,
defaultStrategyFn,
getPromise
) {
var numArgs = typeof originalFn === 'function' ? originalFn.length : 0,
wrapper = makeFunc(numArgs, function() {
return spy.apply(this, Array.prototype.slice.call(arguments));
@@ -129,6 +135,10 @@ getJasmineRequireObj().Spy = function(j$) {
};
wrapper.calls = callTracker;
if (defaultStrategyFn) {
defaultStrategyFn(wrapper.and);
}
return wrapper;
}