Skip to content

Commit

Permalink
fix: Catch comparison file load failure and trigger test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbarber committed Mar 3, 2024
1 parent 4dd368c commit aabe67e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ const getStatsComparisonAndPopulateDiffIfAny = async (args) => {
? { percentage: 1, testFailed: true }
: { percentage: 0, testFailed: false }
}

const comparisonImg = await parseImage(paths.image.comparison(args.testName))
let comparisonImg
try {
comparisonImg = await parseImage(paths.image.comparison(args.testName))
} catch (e) {
return { percentage: 1, testFailed: true }
}
const diff = new PNG({
width: Math.max(comparisonImg.width, baselineImg.width),
height: Math.max(comparisonImg.height, baselineImg.height),
Expand Down

0 comments on commit aabe67e

Please sign in to comment.