From 31e4f06094f6202f75eb4949e7d7cea207fd0408 Mon Sep 17 00:00:00 2001 From: Ramon Ziai Date: Mon, 8 Apr 2024 08:39:58 +0200 Subject: [PATCH] fix(command.ts): align order of variables with error message 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. --- src/command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command.ts b/src/command.ts index 3500f8c..b553a88 100644 --- a/src/command.ts +++ b/src/command.ts @@ -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}`