๐งชTesting
Basics of Testing in React Apps.
Last updated
Basics of Testing in React Apps.
Last updated
What is testing? Why do we need tests.
There are 3 basic categories of automated tests:
Unit Tests
Integration Tests
End-to-end (e2e) Tests
These are the most common and important type of tests. Unit tests are basically the ones that test the individual building blocks (functions, components) of the app in isolation.
A typical app contains dozens and hundreds of unit tests.
Integration tests usually test the combination of multiple building blocks. Projects typically contain a couple of integration tests. These are also important, but the focus is more on unit tests.
These automated tests test the complete scenarios in our app as the user would experience them. Projects typically contain a few end-to-end tests. These types of test are important, but can also be done manually (partially).
We'll be working with unit tests, so typically we will be testing the smallest building blocks of our code.