Why Test?
-
Get an error if you break code
-
save time
-
Think about possible issues & bugs
-
integrate into build workflow
-
Performance
-
Features
-
Usability
1: unit test, api test, integration, component, ui test, e2e.
module under test ? isolation mock something else which is using in components
++++ What makes a good test +++++
- run fast
- test should not break.
- easy to read and understand.
- good coverage to effort ratio.
- mocking too much reduce test quality.
+++++++ Test Strcuture ++++++++
- Initial Setup for rendering.
- Disptach an action.
- expect data to change.
ESLint: basically check the code & test the basic error