-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hasSizeMismatch auto-failure should be made optional #83
Comments
So you're proposing a flag to disable that behavior? I wouldn't be opposed to that. In terms of your issue at hand have you tried running the tests inside a docker container? That is what we do to prevent differences between operating systems. I believe CodeSandbox does that same thing. |
Hey @phawxby, I had similar issue and can suggest few things:
Hope that helps 🙌 |
Thanks for the help guys. I ended up getting this solved last week using Docker, and helpfully CircleCI publish their docker images publicly so I'm actually generating the image snapshots using the exact same docker image that's I'm using during CI, very helpful. As for auto-cropping, I'm using puppeteer element screenshot of which natively crops the screenshot to just that of the target element. I think I've got this one all covered. Thanks |
Hope can add hasSizeMismatch can be optional, because sometimes want to ignore 1px or 2px differences. @anescobar1991 Will accept PR? Add one option, no 'harm', right? |
) if the option `allowSizeMismatch` is set, a build will not always fail on images with different sizes. Missing or Added Pixel will be counted as a mismatch and respected by the set threshold. Related americanexpress#83, americanexpress#85
# [3.1.0](americanexpress/jest-image-snapshot@v3.0.1...v3.1.0) (2020-04-17) ### Features * **options:** add option to pass on size missmatch ([americanexpress#174](americanexpress#174)) ([cee46b1](americanexpress@cee46b1)), closes [americanexpress#83](americanexpress#83) [americanexpress#85](americanexpress#85)
We develop on windows but visual regression runs on Linux. The the most-part this is fine, however every now and then we find a component might render 1px bigger or smaller in terms of crop, it's otherwise identical.
https://github.com/americanexpress/jest-image-snapshot/blob/master/src/diff-snapshot.js#L130
The text was updated successfully, but these errors were encountered: