@@ -7,6 +7,7 @@ describe('Jasmine', function() {
7
7
this . bootedJasmine = {
8
8
getEnv : jasmine . createSpy ( 'getEnv' ) . and . returnValue ( {
9
9
addReporter : jasmine . createSpy ( 'addReporter' ) ,
10
+ provideFallbackReporter : jasmine . createSpy ( 'provideFallbackReporter' ) ,
10
11
execute : jasmine . createSpy ( 'execute' ) ,
11
12
throwOnExpectationFailure : jasmine . createSpy ( 'throwOnExpectationFailure' ) ,
12
13
randomizeTests : jasmine . createSpy ( 'randomizeTests' )
@@ -65,7 +66,7 @@ describe('Jasmine', function() {
65
66
this . testJasmine . configureDefaultReporter ( reporterOptions ) ;
66
67
67
68
expect ( Jasmine . ConsoleReporter ) . toHaveBeenCalledWith ( expectedReporterOptions ) ;
68
- expect ( this . testJasmine . env . addReporter ) . toHaveBeenCalledWith ( { someProperty : 'some value' } ) ;
69
+ expect ( this . testJasmine . env . provideFallbackReporter ) . toHaveBeenCalledWith ( { someProperty : 'some value' } ) ;
69
70
} ) ;
70
71
71
72
it ( 'creates a reporter with a default option if an option is not specified' , function ( ) {
@@ -81,7 +82,7 @@ describe('Jasmine', function() {
81
82
} ;
82
83
83
84
expect ( Jasmine . ConsoleReporter ) . toHaveBeenCalledWith ( expectedReporterOptions ) ;
84
- expect ( this . testJasmine . env . addReporter ) . toHaveBeenCalledWith ( { someProperty : 'some value' } ) ;
85
+ expect ( this . testJasmine . env . provideFallbackReporter ) . toHaveBeenCalledWith ( { someProperty : 'some value' } ) ;
85
86
} ) ;
86
87
87
88
it ( 'sets the defaultReporterAdded flag' , function ( ) {
@@ -289,15 +290,16 @@ describe('Jasmine', function() {
289
290
expect ( this . testJasmine . env . execute ) . toHaveBeenCalled ( ) ;
290
291
} ) ;
291
292
292
- it ( 'does not add a default reporter if a reporter was already added ' , function ( ) {
293
+ it ( 'adds a default reporter as a fallback reporter ' , function ( ) {
293
294
this . testJasmine . addReporter ( new Jasmine . ConsoleReporter ( { } ) ) ;
294
295
295
- spyOn ( this . testJasmine , 'configureDefaultReporter' ) ;
296
+ // spyOn(this.testJasmine, 'configureDefaultReporter');
296
297
spyOn ( this . testJasmine , 'loadSpecs' ) ;
297
298
298
299
this . testJasmine . execute ( ) ;
299
300
300
- expect ( this . testJasmine . configureDefaultReporter ) . not . toHaveBeenCalled ( ) ;
301
+ expect ( this . testJasmine . env . provideFallbackReporter ) . toHaveBeenCalled ( ) ;
302
+ expect ( this . testJasmine . env . addReporter ) . toHaveBeenCalled ( ) ;
301
303
expect ( this . testJasmine . loadSpecs ) . toHaveBeenCalled ( ) ;
302
304
expect ( this . testJasmine . env . execute ) . toHaveBeenCalled ( ) ;
303
305
} ) ;
0 commit comments