File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,7 @@ Wraith.prototype.compareScreenshots = function() {
240
240
}
241
241
242
242
self . compareQueue = [ ] ;
243
+ self . maxMismatch = 0 ;
243
244
244
245
for ( var url in self . urls ) {
245
246
var dir = self . urls [ url ] . substring ( 1 ) . replace ( / \/ + $ / , '' ) + '/' ;
@@ -278,6 +279,7 @@ Wraith.prototype.compareScreenshots = function() {
278
279
async . eachLimit ( self . compareQueue , self . maxConnections , function ( task , callback ) {
279
280
resemble ( './' + task . base ) . compareTo ( './' + task . compare ) . ignoreAntialiasing ( ) . onComplete ( function ( data ) {
280
281
data . getDiffImage ( ) . pack ( ) . pipe ( fs . createWriteStream ( task . output ) ) ;
282
+ self . maxMismatch = data . misMatchPercentage > self . maxMismatch ? data . misMatchPercentage : self . maxMismatch ;
281
283
fs . writeFile ( './' + task . diff , data . misMatchPercentage , function ( err ) {
282
284
if ( err ) { log . error ( err ) ; }
283
285
if ( bar ) {
@@ -298,7 +300,7 @@ Wraith.prototype.compareScreenshots = function() {
298
300
self . generateGallery ( ) ;
299
301
} else {
300
302
helpers . emptyFolder ( self . outputFolder , function ( ) {
301
- self . cb ( ) ;
303
+ self . cb ( self . maxMismatch ) ;
302
304
} ) ;
303
305
}
304
306
return self ;
@@ -314,6 +316,6 @@ Wraith.prototype.generateGallery = function() {
314
316
self . outputFolder ,
315
317
self . config . project ,
316
318
self . server ,
317
- self . cb
319
+ function ( ) { self . cb ( self . maxMismatch ) ; }
318
320
) ;
319
321
} ;
You can’t perform that action at this time.
0 commit comments