-
Notifications
You must be signed in to change notification settings - Fork 4
Testing
In a team meeting we discussed testing our application. We realised that there were a large amount aspects of our application that we could test, so we had to decide on what was most important. Since most of our data came from simple calls to the spotify api, these routes seemed unneccessary to test. Testing our MongoDB database would be difficult as it is hosted on the cloud and would require a large amount of setup and teardown. Furthermore, the API calls were mostly simple and were provided by Mongoose Crudify. Testing our React frontend seemed unneccessary as it was small enough of an application to visually test easily. This left Redux, which facilitated all of the state in our application. Throughout development we found that Redux was often the cause of many errors that we did not notice due to it being split up across many files and requiring rather specific and unique syntax.
We decided it would be the most beneficial to test whether our Redux reducers updated the state correctly when actions were dispatched. To do this, we utilised JEST and created a test suite containing a method for each redux action in our application. On top of this, we ensured the initial state of the application was correct. This test suite quickly pointed out any error in our redux reducers, significantly reducing the time we had to spend finding bugs in our application.