← Browse all tools

Go Back
Report Abuse

jest-image-snapshot

Jest matcher for image comparisons

Tool overview

jest-image-snapshot is a Jest matcher that performs image comparisons using pixelmatch and behaves like Jest snapshots. It is commonly used for visual regression testing.

Given a PNG image, for example a screenshot taken with Puppeteer or Playwright, the toMatchImageSnapshot() matcher stores a baseline image on the first run and compares later images with it. When they differ, a diff image highlighting the changes is produced and the test fails. Snapshots are updated when the changes are expected, and the difference threshold, a Gaussian blur against noise and the diff layout can be customised.

jest-image-snapshot is developed by American Express and is free and open source under the Apache 2.0 licence.

Screenshots & video

Community reviews

Login to Write Your Review

There are no reviews yet.

Source & attribution

Original contributor
Jean-Baptiste CROUIGNEAU
External references
https://github.com/americanexpress/jest-image-snapshot