diff --git a/spec/core/integration/CustomObjectFormatterSpec.js b/spec/core/integration/CustomObjectFormatterSpec.js index 2c61d9e0..eec264dc 100644 --- a/spec/core/integration/CustomObjectFormatterSpec.js +++ b/spec/core/integration/CustomObjectFormatterSpec.js @@ -42,7 +42,7 @@ describe('Custom object formatters', function() { }); env.describe('with custom pretty-printer', function() { - env.beforeEach(function() { + env.beforeAll(function() { env.addCustomObjectFormatter(function(obj) { return 'custom(' + obj + ')'; }); diff --git a/src/core/Env.js b/src/core/Env.js index a70413b8..62454373 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -424,6 +424,9 @@ getJasmineRequireObj().Env = function(j$) { resources.customAsyncMatchers = j$.util.clone( runnableResources[parentRunnableId].customAsyncMatchers ); + resources.customObjectFormatters = j$.util.clone( + runnableResources[parentRunnableId].customObjectFormatters + ); resources.defaultStrategyFn = runnableResources[parentRunnableId].defaultStrategyFn; }