@@ -381,7 +381,7 @@ export async function toHaveScreenshot(
381381 // We tried re-generating new snapshot but failed.
382382 // This can be due to e.g. spinning animation, so we want to show it as a diff.
383383 if ( errorMessage ) {
384- const header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout : timedOut ? timeout : undefined } ) ;
384+ const header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout, timedOut } ) ;
385385 return helper . handleDifferent ( actual , undefined , previous , diff , header , errorMessage , log , this . _stepInfo ) ;
386386 }
387387
@@ -416,12 +416,12 @@ export async function toHaveScreenshot(
416416 if ( helper . updateSnapshots === 'changed' || helper . updateSnapshots === 'all' ) {
417417 if ( actual )
418418 return writeFiles ( actual ) ;
419- let header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout : timedOut ? timeout : undefined } ) ;
419+ let header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout, timedOut } ) ;
420420 header += ' Failed to re-generate expected.\n' ;
421421 return helper . handleDifferent ( actual , expectScreenshotOptions . expected , previous , diff , header , errorMessage , log , this . _stepInfo ) ;
422422 }
423423
424- const header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout : timedOut ? timeout : undefined } ) ;
424+ const header = formatMatcherMessage ( this , { matcherName : 'toHaveScreenshot' , locator, expectation : 'expected' , timeout, timedOut } ) ;
425425 return helper . handleDifferent ( actual , expectScreenshotOptions . expected , previous , diff , header , errorMessage , log , this . _stepInfo ) ;
426426}
427427
0 commit comments