@@ -155,48 +155,61 @@ export default class DefaultReporter extends BaseReporter {
155155 testResult : TestResult ,
156156 aggregatedResults : AggregatedResult ,
157157 ) {
158- this . _status . testFinished (
159- test . context . config ,
160- testResult ,
161- aggregatedResults ,
162- ) ;
163- this . _printTestFileSummary (
164- testResult . testFilePath ,
165- test . context . config ,
166- testResult ,
167- ) ;
158+ this . testFinished ( test . context . config , testResult , aggregatedResults ) ;
159+ if ( ! testResult . skipped ) {
160+ this . printTestFileHeader (
161+ testResult . testFilePath ,
162+ test . context . config ,
163+ testResult ,
164+ ) ;
165+ this . printTestFileFailureMessage (
166+ testResult . testFilePath ,
167+ test . context . config ,
168+ testResult ,
169+ ) ;
170+ }
168171 this . forceFlushBufferedOutput ( ) ;
169172 }
170173
171- _printTestFileSummary (
174+ testFinished (
175+ config : ProjectConfig ,
176+ testResult : TestResult ,
177+ aggregatedResults : AggregatedResult ,
178+ ) {
179+ this . _status . testFinished ( config , testResult , aggregatedResults ) ;
180+ }
181+
182+ printTestFileHeader (
172183 testPath : Path ,
173184 config : ProjectConfig ,
174185 result : TestResult ,
175186 ) {
176- if ( ! result . skipped ) {
177- this . log ( getResultHeader ( result , this . _globalConfig , config ) ) ;
178-
179- const consoleBuffer = result . console ;
180- if ( consoleBuffer && consoleBuffer . length ) {
181- this . log (
182- ' ' +
183- TITLE_BULLET +
184- 'Console\n\n' +
185- getConsoleOutput (
186- config . cwd ,
187- ! ! this . _globalConfig . verbose ,
188- consoleBuffer ,
189- ) ,
190- ) ;
191- }
192-
193- if ( result . failureMessage ) {
194- this . log ( result . failureMessage ) ;
195- }
187+ this . log ( getResultHeader ( result , this . _globalConfig , config ) ) ;
188+ const consoleBuffer = result . console ;
189+ if ( consoleBuffer && consoleBuffer . length ) {
190+ this . log (
191+ ' ' +
192+ TITLE_BULLET +
193+ 'Console\n\n' +
194+ getConsoleOutput (
195+ config . cwd ,
196+ ! ! this . _globalConfig . verbose ,
197+ consoleBuffer ,
198+ ) ,
199+ ) ;
200+ }
201+ }
196202
197- const didUpdate = this . _globalConfig . updateSnapshot === 'all' ;
198- const snapshotStatuses = getSnapshotStatus ( result . snapshot , didUpdate ) ;
199- snapshotStatuses . forEach ( this . log ) ;
203+ printTestFileFailureMessage (
204+ testPath : Path ,
205+ config : ProjectConfig ,
206+ result : TestResult ,
207+ ) {
208+ if ( result . failureMessage ) {
209+ this . log ( result . failureMessage ) ;
200210 }
211+ const didUpdate = this . _globalConfig . updateSnapshot === 'all' ;
212+ const snapshotStatuses = getSnapshotStatus ( result . snapshot , didUpdate ) ;
213+ snapshotStatuses . forEach ( this . log ) ;
201214 }
202215}
0 commit comments