Allow custom spy strategies to be inherited like other runnable resources

This commit is contained in:
Steve Gravrock
2021-11-17 12:50:16 -08:00
parent 7a685b16f6
commit 871ba99a30
3 changed files with 7 additions and 1 deletions

View File

@@ -1604,6 +1604,9 @@ getJasmineRequireObj().Env = function(j$) {
resources.customObjectFormatters = j$.util.clone(
runnableResources[parentRunnableId].customObjectFormatters
);
resources.customSpyStrategies = j$.util.clone(
runnableResources[parentRunnableId].customSpyStrategies
);
resources.defaultStrategyFn =
runnableResources[parentRunnableId].defaultStrategyFn;
}

View File

@@ -16,7 +16,7 @@ describe('Custom Spy Strategies (Integration)', function() {
var jasmineDone = jasmine.createSpy('jasmineDone');
env.describe('suite defining a custom spy strategy', function() {
env.beforeEach(function() {
env.beforeAll(function() {
env.addSpyStrategy('frobnicate', strategy);
});

View File

@@ -441,6 +441,9 @@ getJasmineRequireObj().Env = function(j$) {
resources.customObjectFormatters = j$.util.clone(
runnableResources[parentRunnableId].customObjectFormatters
);
resources.customSpyStrategies = j$.util.clone(
runnableResources[parentRunnableId].customSpyStrategies
);
resources.defaultStrategyFn =
runnableResources[parentRunnableId].defaultStrategyFn;
}