Bug fixes and features should always come with tests. A guide for writing tests has been provided in each repository to make the process easier. Looking at other tests to see how they should be structured can also help.
The test files should live next to the code that it is testing.
Before submitting your changes in a pull request, always run the full test suite.
-
Unit - test both front and back end code in isolation
- backend - jest
- frontend - jest, react testing library, react testing library hooks
-
Integration - test our APIs
-
E2E - to test the full stack completely on critical flows
- cypress
- When selecting dom elements use
data-test-*
instead of using a class or id.
- When selecting dom elements use
- cypress
Separate the business logic from the view as much as possible. Create hooks, helpers & reducers to utilize this logic from the UI and test that code in isolation from its UI.