How to Jest Snapshot Test the Difference

added by JavaScript Kicks
8/19/2019 7:07:41 AM

379 Views

Snapshot tests are a common way to write lightweight component tests. When a snapshot test runs for the first time, it stores its output (e.g. rendered component's HTML structure) in a snapshot output file. Every time the snapshot test runs again, another snapshot output file gets created; which is used to diff the output against the old snapshot test's output file.


0 comments