Using Snapshots

Understanding snapshot testing

A snapshot test defines the result of a test and stores the result in a snapshot the first time the test is executed. On subsequent test executions, the result is compared against the baseline snapshot, and if there is a difference, the test fails.

Snapshots can be useful when checking result objects or arrays. They can also be used to check portions of the DOM.

Get hands-on with 1200+ tech skills courses.