What is snapshot testing?

Updated May 6, 2026

Short answer

Snapshot testing compares UI output with stored snapshots.

Deep explanation

It detects unintended UI changes by comparing current output with saved reference snapshots.

Real-world example

Testing React UI components.

Common mistakes

  • Accepting incorrect snapshots blindly.

Follow-up questions

  • When to update snapshots?
  • Limitations?

More Unit Testing interview questions

View all →