@@ -408,6 +408,102 @@ describe("ConsoleReporter", function() {
408
408
expect ( this . out . getOutput ( ) ) . toContain ( "Incomplete: not all bars were frobnicated" ) ;
409
409
} ) ;
410
410
411
+ it ( "reports a summary when done that shows info for a failed spec with no expectations" , function ( ) {
412
+ var reporter = new ConsoleReporter ( ) ;
413
+ reporter . setOptions ( {
414
+ print : this . out . print ,
415
+ jasmineCorePath : jasmineCorePath
416
+ } ) ;
417
+
418
+ reporter . jasmineStarted ( ) ;
419
+ reporter . specDone ( { status : "passed" } ) ;
420
+ reporter . specDone ( {
421
+ status : "failed" ,
422
+ description : "with a failing spec" ,
423
+ fullName : "A suite with a failing spec that has no expectations" ,
424
+ failedExpectations : [ ]
425
+ } ) ;
426
+
427
+ this . out . clear ( ) ;
428
+
429
+ reporter . jasmineDone ( ) ;
430
+
431
+ expect ( this . out . getOutput ( ) ) . toContain ( "Spec has no expectations" ) ;
432
+ } ) ;
433
+
434
+ it ( 'reports a summary without "no expectations" message for a spec having failed expectations' , function ( ) {
435
+ var reporter = new ConsoleReporter ( ) ;
436
+ reporter . setOptions ( {
437
+ print : this . out . print ,
438
+ jasmineCorePath : jasmineCorePath
439
+ } ) ;
440
+
441
+ reporter . jasmineStarted ( ) ;
442
+ reporter . specDone ( {
443
+ status : "failed" ,
444
+ description : "with a failing spec" ,
445
+ fullName : "A suite with a failing spec that has a failing expectation" ,
446
+ failedExpectations : [ {
447
+ passed : false ,
448
+ message : "Expected true to be false." ,
449
+ expected : false ,
450
+ actual : true ,
451
+ stack : undefined
452
+ } ]
453
+ } ) ;
454
+
455
+ this . out . clear ( ) ;
456
+
457
+ reporter . jasmineDone ( ) ;
458
+
459
+ expect ( this . out . getOutput ( ) ) . not . toContain ( "Spec has no expectations" ) ;
460
+ } ) ;
461
+
462
+ it ( 'reports a summary without a "no expectations" message for a spec having passed expectations' , function ( ) {
463
+ var reporter = new ConsoleReporter ( ) ;
464
+ reporter . setOptions ( {
465
+ print : this . out . print ,
466
+ jasmineCorePath : jasmineCorePath
467
+ } ) ;
468
+
469
+ reporter . jasmineStarted ( ) ;
470
+ reporter . specDone ( {
471
+ status : "passed" ,
472
+ description : "with a passed spec" ,
473
+ fullName : "A suite with a passed spec" ,
474
+ passedExpectations : [ {
475
+ passed : true ,
476
+ message : "Expected true to be true." ,
477
+ expected : true ,
478
+ actual : true
479
+ } ]
480
+ } ) ;
481
+ reporter . specDone ( {
482
+ status : "failed" ,
483
+ description : "with a failing spec" ,
484
+ fullName : "A suite with a failing spec that has both passed and failing expectations" ,
485
+ failedExpectations : [ {
486
+ passed : false ,
487
+ message : "Expected true to be false." ,
488
+ expected : false ,
489
+ actual : true ,
490
+ stack : undefined
491
+ } ] ,
492
+ passedExpectations : [ {
493
+ passed : true ,
494
+ message : "Expected true to be true." ,
495
+ expected : true ,
496
+ actual : true
497
+ } ]
498
+ } ) ;
499
+
500
+ this . out . clear ( ) ;
501
+
502
+ reporter . jasmineDone ( ) ;
503
+
504
+ expect ( this . out . getOutput ( ) ) . not . toContain ( "Spec has no expectations" ) ;
505
+ } ) ;
506
+
411
507
it ( "displays all afterAll exceptions" , function ( ) {
412
508
var reporter = new ConsoleReporter ( ) ;
413
509
reporter . setOptions ( {
0 commit comments