Skip to main content

Testing

There are three types of testing in the front-end. Unit testing, integration testing and snapshot testing.

Unit testing:#

It's a way to test each individual component in isolation making sure it's doing the work we are expecting it to do by putting assumptions on most of its pieces that make up this component.

popular unit testing tools:#

Integration testing#

It's a way to test if a group of components are working as expected when they are combined together.

popular Integration testing tools:#

Cypress

Snapshot testing#

Well Snapshot testing is similar to unit testing. It's also intended for testing individual components. But unlike unit testing, snapshot testing allows you to take a snapshot of a component at a given point in time and save what it renders. And everytime you run that test, jest will check if the output of that component matches the stored output of the snapshot and it warns you if there is a change. This way you would know if you accidently changed something. The stored snapshot behaves like auto generated assumptions about your component.

Last updated on by bigfanjs