DEV Community

Cover image for OSD700: Unit Tests & Code Reviews
TD
TD

Posted on

OSD700: Unit Tests & Code Reviews

This week I only got to contribute a little to Starchart, as I was still familiarizing myself with BullMQ Worker Queues. However, I finished writing unit tests for Nodemailer that essentially send an email notification via Nodemailer transport. It then verifies whether the email is received by the fake SMTP server established using MailHog.

Unit Tests & Mixed Reception

My PR received mixed reception primarily because it needed comments. A unit test should be well documented, so programmers can understand what the code is doing. Adding documentation may be time-consuming as I also have to focus on implementing the core functionality, blogging about it, doing code reviews, and ensuring I stay caught up in other courses. However, there are solutions like TSDoc which documents the code for you, so as a programmer, you can spend more time programming and less time documenting.

Next Steps

This week, I intend on working on what I could not get done last week: sending test notifications when a domain status updates to pending or error. Making notifications work using BullMQ's Workers/Queues will probably be one of my most significant PR this semester, and I have to ensure I do it right, so it is well received.

Top comments (0)