DEV Community

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

Posted on

2

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.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay