Skip to content

Commit

Permalink
test: allow for higher difference threshold in PNG effort result
Browse files Browse the repository at this point in the history
Covers platform difference between mac and linux (sharp#3783)
This pattern is already used elsewhere
  • Loading branch information
moorejs committed Nov 1, 2023
1 parent 7752c28 commit befee19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/transforms/__tests__/format.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ describe('format', () => {
test('png w/ effort', async () => {
const { image } = await applyTransforms([format({ format: 'png', effort: '1' }, dirCtx)!], img)

expect(await image.toBuffer()).toMatchImageSnapshot()
expect(await image.toBuffer()).toMatchImageSnapshot({
failureThreshold: 0.05,
failureThresholdType: 'percent'
})
})

test('webp w/ effort', async () => {
Expand Down

0 comments on commit befee19

Please sign in to comment.