Skip to content

Commit

Permalink
test: print more detail when an image diff fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rprieto committed Sep 6, 2022
1 parent 5a98c56 commit 4a34959
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/integration/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ function compareMetadata (expected, actual, fields) {
}

function compareVisual (expected, actual, tolerance, done) {
gm.compare(expected, actual, tolerance, (err, similar, equality) => {
gm.compare(expected, actual, tolerance, (err, similar, equality, raw) => {
if (err) throw err
should(similar).eql(true)
should(similar).eql(true, `
Equality > tolerance (${equality.toFixed(5)} > ${tolerance})
Raw comparison: ${raw}
`)
done()
})
}
Expand Down

0 comments on commit 4a34959

Please sign in to comment.