File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,13 @@ function extractErrorsFromRetries(retries) {
6464 const errorsInRetry = new Set ( ) ;
6565
6666 for ( const retry of retries ) {
67- for ( const { error} of [ ...retry . imagesInfo , retry ] ) {
67+ for ( const { error, diffImg } of [ ...retry . imagesInfo , retry ] ) {
6868 if ( get ( error , 'message' ) ) {
6969 errorsInRetry . add ( error . message ) ;
7070 }
71+ if ( diffImg ) {
72+ errorsInRetry . add ( 'image comparison failed' ) ;
73+ }
7174 }
7275 }
7376 return [ ...errorsInRetry ] ;
Original file line number Diff line number Diff line change 88 mkSuiteTree,
99 mkTestResult
1010} = require ( '../../../utils' ) ;
11+ const { mkImg_} = require ( '../components/utils' ) ;
1112
1213describe ( 'static/modules/group-errors' , ( ) => {
1314 it ( 'should not collect errors from success test' , ( ) => {
@@ -75,6 +76,29 @@ describe('static/modules/group-errors', () => {
7576 ] ) ;
7677 } ) ;
7778
79+ it ( 'should collect image comparison fails' , ( ) => {
80+ const suites = [
81+ mkSuiteTree ( {
82+ browsers : [
83+ mkBrowserResult ( {
84+ result : mkTestResult ( {
85+ imagesInfo : [
86+ { diffImg : mkImg_ ( ) }
87+ ]
88+ } )
89+ } )
90+ ]
91+ } )
92+ ] ;
93+
94+ const result = groupErrors ( { suites} ) ;
95+
96+ assert . strictEqual ( result . length , 1 ) ;
97+ assert . strictEqual ( result [ 0 ] . count , 1 ) ;
98+ assert . strictEqual ( result [ 0 ] . name , 'image comparison failed' ) ;
99+ assert . strictEqual ( result [ 0 ] . pattern , 'image comparison failed' ) ;
100+ } ) ;
101+
78102 it ( 'should collect errors from result and retries' , ( ) => {
79103 const suites = [
80104 mkSuiteTree ( {
You can’t perform that action at this time.
0 commit comments