@@ -48,21 +48,37 @@ var TestReporter = function (browser) {
48
48
49
49
this . jasmineStarted = function ( suiteInfo ) {
50
50
this . runnerStartTime = this . now ( ) ;
51
- sendInfo ( "Started tests for " + browser + "." ) ;
51
+
52
+ const total = suiteInfo . totalSpecsDefined ;
53
+ const seed = suiteInfo . order . seed ;
54
+ sendInfo ( `Started ${ total } tests for ${ browser } with seed ${ seed } .` ) ;
52
55
} ;
53
56
54
- this . suiteStarted = function ( result ) { } ;
57
+ this . suiteStarted = function ( result ) {
58
+ // Normally suite starts don't have to be reported because the individual
59
+ // specs inside them are reported, but it can happen that the suite cannot
60
+ // start, for instance due to an uncaught exception in `beforeEach`. This
61
+ // is problematic because the specs inside the suite will never be found
62
+ // and run, so if we don't report the suite start failure here it would be
63
+ // ignored silently, leading to passing tests even though some did not run.
64
+ if ( result . failedExpectations . length > 0 ) {
65
+ let failedMessages = "" ;
66
+ for ( const item of result . failedExpectations ) {
67
+ failedMessages += `${ item . message } ` ;
68
+ }
69
+ sendResult ( "TEST-UNEXPECTED-FAIL" , result . description , failedMessages ) ;
70
+ }
71
+ } ;
55
72
56
73
this . specStarted = function ( result ) { } ;
57
74
58
75
this . specDone = function ( result ) {
59
76
if ( result . failedExpectations . length === 0 ) {
60
77
sendResult ( "TEST-PASSED" , result . description ) ;
61
78
} else {
62
- var failedMessages = "" ;
63
- var items = result . failedExpectations ;
64
- for ( var i = 0 , ii = items . length ; i < ii ; i ++ ) {
65
- failedMessages += items [ i ] . message + " " ;
79
+ let failedMessages = "" ;
80
+ for ( const item of result . failedExpectations ) {
81
+ failedMessages += `${ item . message } ` ;
66
82
}
67
83
sendResult ( "TEST-UNEXPECTED-FAIL" , result . description , failedMessages ) ;
68
84
}
@@ -71,7 +87,7 @@ var TestReporter = function (browser) {
71
87
this . suiteDone = function ( result ) { } ;
72
88
73
89
this . jasmineDone = function ( ) {
74
- // Give the test.py some time process any queued up requests
90
+ // Give the test runner some time process any queued requests.
75
91
setTimeout ( sendQuitRequest , 500 ) ;
76
92
} ;
77
93
} ;
0 commit comments