Maintaining Snapshots

Intentional vs. unintentional changes

Like all tests, our snapshot tests are only as helpful as we design them to be. When designed and maintained properly, they can alert us to valuable insights regarding changes in our user interface. The tricky part about this is that obviously at times, we want our interfaces to change. We may have added a new feature or reworked the design of an existing one. Perhaps we were even fixing a recently uncovered bug in our user experience. These situations represent instances in which we are making intentional changes to our user interface, but Jest has no way of knowing this. It cannot differentiate on its own between intentional and unintentional changes within a new snapshot.

Get hands-on with 1400+ tech skills courses.