@@ -70,31 +70,33 @@ export default class DotNetTestLoggerObserver extends BaseLoggerObserver {
7070 }
7171
7272 private handleReportDotnetTestResults ( event : ReportDotNetTestResults ) {
73- this . logger . appendLine ( "----- Test Execution Summary -----" ) ;
74- this . logger . appendLine ( '' ) ;
75-
76- // Omnisharp returns null results if there are build failures
77- const results = event . results || [ ] ;
78- const totalTests = results . length ;
79-
80- let totalPassed = 0 , totalFailed = 0 , totalSkipped = 0 ;
81- for ( let result of results ) {
82- this . logTestResult ( result ) ;
83- switch ( result . Outcome ) {
84- case protocol . V2 . TestOutcomes . Failed :
85- totalFailed += 1 ;
86- break ;
87- case protocol . V2 . TestOutcomes . Passed :
88- totalPassed += 1 ;
89- break ;
90- case protocol . V2 . TestOutcomes . Skipped :
91- totalSkipped += 1 ;
92- break ;
73+ if ( event . results ) {
74+ this . logger . appendLine ( "----- Test Execution Summary -----" ) ;
75+ this . logger . appendLine ( '' ) ;
76+
77+ // Omnisharp returns null results if there are build failures
78+ const results = event . results ;
79+ const totalTests = results . length ;
80+
81+ let totalPassed = 0 , totalFailed = 0 , totalSkipped = 0 ;
82+ for ( let result of results ) {
83+ this . logTestResult ( result ) ;
84+ switch ( result . Outcome ) {
85+ case protocol . V2 . TestOutcomes . Failed :
86+ totalFailed += 1 ;
87+ break ;
88+ case protocol . V2 . TestOutcomes . Passed :
89+ totalPassed += 1 ;
90+ break ;
91+ case protocol . V2 . TestOutcomes . Skipped :
92+ totalSkipped += 1 ;
93+ break ;
94+ }
9395 }
94- }
9596
96- this . logger . appendLine ( `Total tests: ${ totalTests } . Passed: ${ totalPassed } . Failed: ${ totalFailed } . Skipped: ${ totalSkipped } ` ) ;
97- this . logger . appendLine ( '' ) ;
97+ this . logger . appendLine ( `Total tests: ${ totalTests } . Passed: ${ totalPassed } . Failed: ${ totalFailed } . Skipped: ${ totalSkipped } ` ) ;
98+ this . logger . appendLine ( '' ) ;
99+ }
98100 }
99101
100102 private logTestResult ( result : protocol . V2 . DotNetTestResult ) {
0 commit comments