|
|
|
|
|
by jluxenberg
2184 days ago
|
|
It's not quite the same as screenshot testing, but I've had success using snapshot testing in React. The idea is outlined here:
https://jestjs.io/docs/en/snapshot-testing Snapshots of the intermediate representation (e.g. JSX in React) will be less brittle than e.g. a screenshot of pixels. It also works best when your UI is a function of some easily-constructed state. Other frameworks sharing these features would also work well with snapshot testing. |
|
Chromatic generates screenshots from component stories for visual change detection with an easy to use and share web UI. It's neat.
[1] https://storybook.js.org [2] https://storybook.js.org/docs/testing/structural-testing/ [3] https://www.chromatic.com