jest-image-snapshot: Error: "Error running image diff." for large images

Hey,

for some of my tests I get the error Error running image diff.. As those are the longest pages e.g.  14252px I assume the length is the deciding factor.

Other pages work fine. The diff file was also created and is in the folder.

Can I do something to fix this (e.g. is there a config option I missed)?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 37 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, this is happening to me to a lot. Curious though I cannot reproduce this issue locally, only when running on CI environment through TeamCity build pipeline

This issue is stale because it has been open 30 days with no activity.

You’re welcome. Let’s see what we can do about finding a really large PNG file…

On Thu, Jul 23, 2020 at 8:06 PM Lukas Oppermann notifications@github.com wrote:

Hey @omnisip https://github.com/omnisip,

to answer your questions:

  1. Puppeteer version 5 is NOT a hard requirement
  2. Do you usually test against live sites? No, but against a local version of the page.
  3. Are you asking about the image generated by the test? This is than a screenshot of theverge, which I have no legal rights to (am not working for, I just used it as a test case). I guess to be on the safe side, you should use a different page, or something.

I tested the fix by copying your changes to diff-snapshot.js into the file in the repo where I found the issue and this seems to have solved it. 👍

Thank you very much for the help & support!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/americanexpress/jest-image-snapshot/issues/210#issuecomment-663206481, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACKQJWQVFJT47Y4MIGZOSDR5CJ3XANCNFSM4NE6LOWQ .

I recently came accross this project: https://github.com/dmtrKovalenko/odiff which could help with image diff. from what I understand odiff is much muster than other similar libraries, including the one used in this project.

It would be nice to expose an option to experimentally try odiff. What do you think?

We’re going to fix this if we can. I’ll submit a patch today if we can get to the bottom of it.

Yes. Very helpful.

There’s an option to run jest image snapshot in process.

Can you add runInProcess: true as soon of the options you pass toMatchSnapshot, and paste the next stack trace here as well?

On Wed, Jul 1, 2020, 00:33 Lukas Oppermann notifications@github.com wrote:

Hey @omnisip https://github.com/omnisip what I get is the following:

Testing Page: privacy › Testing viewport: desktop-extra-large

Error running image diff.

67 | })

68 | // compare screenshot

69 | expect(image).toMatchImageSnapshot(config.setConfig({

 |                   ^

70 | filename: ${viewport},

71 | snapshotPath: ${config.basePath}/baseline/${currentCase.folder},

72 | diffPath: ${config.testSnaps}/${currentCase.folder}

at runDiffImageToSnapshot (node_modules/jest-image-snapshot/src/diff-snapshot.js:277:11)

at Object.toMatchImageSnapshot (node_modules/jest-image-snapshot/src/index.js:194:7)

at tests/integration/ui.baseTest.js:69:19

Does that help?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/americanexpress/jest-image-snapshot/issues/210#issuecomment-652221204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACKQJXNA3SNDRIRW3TDAA3RZLKC5ANCNFSM4NE6LOWQ .