Problem
We need to add some testing to the project. For now we are adding testing just to the backend just to make sure traffic related data are retrieved correctly. Starting from the backend should also introduce a less steep learning curve for Jest testing framework.
Approach
We will be adding unit tests and integration tests to ensure the backend is running properly:
Unit Test: We will be testing that the routes and the service are running properly. The model won't be needing tests because it is handled by mongoose . All of these unit tests are read-only operations, a lot of the tests will be fairly trivial other than some date-related validations. This will be a good intro into Jest framework.
Integration Test: These are the more interesting tests because we can test the whole server stack, including the database aggregation query, which is the critical part of the server logic for this project. We will be using in-memory MongoDB to help building mock data and database.
Problem We need to add some testing to the project. For now we are adding testing just to the backend just to make sure traffic related data are retrieved correctly. Starting from the backend should also introduce a less steep learning curve for Jest testing framework.
Approach We will be adding unit tests and integration tests to ensure the backend is running properly:
mongoose
. All of these unit tests are read-only operations, a lot of the tests will be fairly trivial other than some date-related validations. This will be a good intro into Jest framework.