DEV Community

Discussion on: React Beginner Question Thread ⚛

Collapse
 
daniel15 profile image
Daniel Lo Nigro

But i don't think "snapshot" tests can totally replace unit testing since "snapshot" tests can't really test interactions isn't it?

A snapshot is simply a different way of performing an assertion, instead of using expect(...).toBe(...). You can write any type of test using snapshots.

Collapse
 
dan_abramov profile image
Dan Abramov

That’s a great point, you actually can test interactions with multiple snapshots.