MichalGoly / QuizTool

Audience response system enabling lecturers to embed interactive quizzes in lecture slides and broadcast them to students in real time - MEAN - Socket.io - AWS - Angular - Express - Docker - docker-compose - CircleCI - Multicontainer Elasticbeanstalk - Selenium Grid
GNU General Public License v2.0
5 stars 1 forks source link

Add tests for the back-end #24

Closed MichalGoly closed 6 years ago

MichalGoly commented 6 years ago

Circle CI should run these during pull requests and master builds

MichalGoly commented 6 years ago

Mocha and Chai could be used here

MichalGoly commented 6 years ago

https://scotch.io/tutorials/test-a-node-restful-api-with-mocha-and-chai

MichalGoly commented 6 years ago

docker-compose made the task a bit harder than expected, and mocha OBVIOUSLY introduced a breaking change with their https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit v4 release and the --exit flag needs to be provided for the tests to exit with a return code, which is essential for CI integration.

MichalGoly commented 6 years ago

changed the estimate to 2. 1 point for "plumbing" the architecture together, the other point for actually writing tests covering the whole application thus far

MichalGoly commented 6 years ago

Half way through writing some back-end tests I found a major bug where I forgot to clone the returned array of lectures before using JS delete to remove files. I was therefore sending PDF files over the network to the lecturer's dashboard for no reason and decreased the app's performance. It has been now fixed