Merge branch 'custom-spy-strategy' into 3.0-features

This commit is contained in:
Gregg Van Hove
2018-01-22 12:12:59 -08:00
18 changed files with 569 additions and 187 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
function SpyRegistry(options) {
options = options || {};
var global = options.global || j$.getGlobal();
var createSpy = options.createSpy;
var currentSpies = options.currentSpies || function() { return []; };
this.allowRespy = function(allow){
@@ -40,7 +41,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
}
var originalMethod = obj[methodName],
spiedMethod = j$.createSpy(methodName, originalMethod),
spiedMethod = createSpy(methodName, originalMethod),
restoreStrategy;
if (Object.prototype.hasOwnProperty.call(obj, methodName) || (obj === global && methodName === 'onerror')) {
@@ -95,7 +96,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
}
var originalDescriptor = j$.util.clone(descriptor),
spy = j$.createSpy(propertyName, descriptor[accessType]),
spy = createSpy(propertyName, descriptor[accessType]),
restoreStrategy;
if (Object.prototype.hasOwnProperty.call(obj, propertyName)) {