...

/

Snapshot Tests

Snapshot Tests

Learn to use snapshots to test data outputs.

Snapshot testing is a technique we can use to test functions that return some large or complex data. Suppose we want to test the full HTML rendered by a large component. We could record a copy of the entire HTML returned by the function. Then, we can make an expectation that the function in our test should always return the same data.

This technique can be helpful to quickly write ...