diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index 4ea60413..3e19b905 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -1282,6 +1282,30 @@ describe("Env integration", function() { env.execute(); }); + it('should report using fallback report', function(done) { + var env = new jasmineUnderTest.Env(), + reporter = jasmine.createSpyObj('fakeReporter', [ + 'specDone', + 'jasmineDone' + ]); + + reporter.jasmineDone.and.callFake(function() { + var specStatus = reporter.specDone.calls.argsFor(0)[0]; + + expect(specStatus.pendingReason).toBe('with a message'); + + done(); + }); + + env.provideFallbackReporter(reporter); + + env.it('will be pending', function() { + env.pending('with a message'); + }); + + env.execute(); + }); + it('should report xdescribes as expected', function(done) { var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ diff --git a/src/core/Env.js b/src/core/Env.js index 5289fd18..81627851 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -263,6 +263,10 @@ getJasmineRequireObj().Env = function(j$) { reporter.addReporter(reporterToAdd); }; + this.provideFallbackReporter = function(reporterToAdd) { + reporter.provideFallbackReporter(reporterToAdd); + }; + var spyRegistry = new j$.SpyRegistry({currentSpies: function() { if(!currentRunnable()) { throw new Error('Spies must be created in a before function or a spec');