{"repo":"americanexpress/jest-image-snapshot","free":true,"listed":false,"github":"https://github.com/americanexpress/jest-image-snapshot","clone":"git clone https://github.com/americanexpress/jest-image-snapshot.git","description":"✨ Jest matcher for image comparisons. Most commonly used for visual regression testing.","language":"JavaScript","stars":3910,"topics":["jest","testing","snapshot","visual-comparison-testing","one-app","image-snapshots","jest-snapshots","image-comparisons"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"Jest matcher that performs image comparisons using pixelmatch and behaves just like Jest snapshots do! Very useful for visual regression testing. 👩‍💻 Hiring 👨‍💻 Want to get paid for your contributions to jest-image-snapshot ? Send your resume to oneamex.careers@aexp.com 📖 Table of Contents Features Usage API Contributing ✨ Features Take image snapshots of your application Ability to compare snapshots from a baseline Update snapshots when you're good with changes Customize a difference threshold Add a Gaussian blur for noise Adjust the diff layout horizontal vs vertical How it works Given an image (Buffer instance with PNG image data) the toMatchImageSnapshot() matcher will create a image snapshots directory in the directory the test is in and will store the baseline snapshot image there on the first run. Note that if customSnapshotsDir option is given then it will store baseline snapshot there instead. On subsequent test runs the matcher will compare the image being passed against the stored snapshot. To update the stored image snapshot run Jest with --updateSnapshot or -u argument. All this works the same way as Jest snapshots. See it in action Typically this matcher is used for visual tests that run on a browser. For example let's say I finish working on a feature and want to write a test to prevent visual regressions: Then after a few days as I finish adding another feature to my component I notice one of my tests failing! Oh no! I must have introduced a regression! L","default_branch":null,"files":null,"tree":[],"storefront":"/r/americanexpress","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/americanexpress/jest-image-snapshot/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}