Vitest
Next generation testing framework powered by Vite
Discover. Evaluate. Test.
Jest matcher for image comparisons
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.
There are no reviews yet.