* 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

@@ -354,5 +354,21 @@ getJasmineRequireObj().interface = function(jasmine, env) {
return env.addSpyStrategy(name, factory);
};
/**
* Set the default spy strategy for the current scope of specs.
*
* _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}.
* @name jasmine.setDefaultSpyStrategy
* @function
* @param {Function} defaultStrategyFn - a function that assigns a strategy
* @example
* beforeEach(function() {
* jasmine.setDefaultSpyStrategy(and => and.returnValue(true));
* });
*/
jasmine.setDefaultSpyStrategy = function(defaultStrategyFn) {
return env.setDefaultSpyStrategy(defaultStrategyFn);
};
return jasmineInterface;
};