Skip to content

Commit

Permalink
fix(command.ts): align order of variables with error message
Browse files Browse the repository at this point in the history
I spent a lot of time debugging failed snapshot tests until I found out that the
variables for expected and observed image dimensions are swapped in the error message.
Can be tested by updating the snapshot and then checking which values change in the message.
Fix is to just put them in the correct order.
  • Loading branch information
ramonziai authored and simonsmith committed Apr 9, 2024
1 parent 5f91c1f commit 31e4f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const matchImageSnapshot =

if (!pass && !added && !updated) {
const message = diffSize
? `Image size (${imageDimensions.baselineWidth}x${imageDimensions.baselineHeight}) different than saved snapshot size (${imageDimensions.receivedWidth}x${imageDimensions.receivedHeight}).\nSee diff for details: ${diffOutputPath}`
? `Image size (${imageDimensions.receivedWidth}x${imageDimensions.receivedHeight}) different than saved snapshot size (${imageDimensions.baselineWidth}x${imageDimensions.baselineHeight}).\nSee diff for details: ${diffOutputPath}`
: `Image was ${
diffRatio * 100
}% different from saved snapshot with ${diffPixelCount} different pixels.\nSee diff for details: ${diffOutputPath}`
Expand Down

0 comments on commit 31e4f06

Please sign in to comment.