Today marks the end of our first Sprint from Oct 10 – Oct 23 for the CS467 Online Capstone Project. Our team will be starting Sprint B (Oct 24 – Nov 6) starting tomorrow where our Sprint Goal is to complete implementation of the Donations API and Teacher Dashboard and Donation UI components.
These past two weeks were a great learning experience. Once we got into the groove of things, we were well on our way completing issues on Jira. Out of all the tasks we needed to complete, creating a test suite was the most difficult. Initially we tried using Jest as our testing framework for the back-end services since that is what the React app uses as their testing suite. However, we ran into an issue where Jest did not play nice with our ES6 modules implementation of our back-end services. I decided to try Mocha instead along with Chai as the assertion library and Supertest for testing of endpoints. The implementation was much easier and I was able to get passing test cases for the Teacher database model and its integration with the API endpoints. Below is an example where I tested the POST /auth/signup endpoint.
The first test case is for when a user successfully signs up for an account, the test expects that the POST route responds with a token property included in the response body. The second test case expects that the Http Status Code 400 is returned since email is a required property when signing up a new user.
Before these tests are ran, the testing framework needs to connect to the MongoDB database and clear out the database after the testing suite is completed so that we don’t have unwanted data in there after the tests. A setupDb function was created to do just this before the test suites.
There is much to learn and implement but so far our team is off to a great start. During this sprint, I’ll be focusing on expanding the integration and unit tests for critical scenarios and API endpoints in addition to implementing the remaining entity models and controller code.