Hacker News new | ask | show | jobs
by lelandfe 1519 days ago
I've heard this called "snapshot testing"

I've used Chromatic before and really enjoyed it: https://www.chromatic.com/features/test

Jest also offers the core functionality if you want to roll your own tests: https://jestjs.io/docs/snapshot-testing

4 comments

I can second the effectiveness of Chromatic, essential for us at crewlinker.com. We have over 80 components with 281 stories, all being checked for visual regressions on every PR. It is also surprisingly effective of just catching regular errors that occur because some rendering logic may indeed result in the app crashing.
I also vouch for Chromatic, it has been extremely valuable for us. It is only working with Storybook, though, as it's made by the same company.
I suppose any decent visual testing tool would work, there are quite a few of them
Thanks! Is Chromatic only for Storybook?
It's tightly integrated with it, so if not "only for Storybook," then near to it. I like Storybook, but it's not worth implementing solely for visual CI testing IMO.

But phrases like "snapshot testing" and "visual regression testing" are what you you/your FE team should be Googling – hopefully there's a tool out there that fits your existing architecture!

Otherwise, as sibling commenters have noted, a policy of screenshots also works.