You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/index.js
+6-1
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ function checkResult({
37
37
snapshotIdentifier,
38
38
chalk,
39
39
dumpDiffToConsole,
40
+
allowSizeMismatch,
40
41
}){
41
42
letpass=true;
42
43
/*
@@ -65,7 +66,7 @@ function checkResult({
65
66
constdifferencePercentage=result.diffRatio*100;
66
67
message=()=>{
67
68
letfailure;
68
-
if(result.diffSize){
69
+
if(result.diffSize&&!allowSizeMismatch){
69
70
failure=`Expected image to be the same size as the snapshot (${result.imageDimensions.baselineWidth}x${result.imageDimensions.baselineHeight}), but was different (${result.imageDimensions.receivedWidth}x${result.imageDimensions.receivedHeight}).\n`;
70
71
}else{
71
72
failure=`Expected image to match or be a close match to snapshot but was ${differencePercentage}% different from snapshot (${result.diffPixelCount} differing pixels).\n`;
@@ -134,6 +135,7 @@ function configureToMatchImageSnapshot({
0 commit comments