Chapter 1: Unit Test Your JavaScript Using Mocha and Chai
by Jani Hartikainen
Have you ever made some changes to your code, and later found it caused something else to break?
I'm sure most of us have. This is almost inevitable, especially when you have a larger amount of code. One thing depends on another, and then changing it breaks something else as a result.
But what if that didn't happen? What if you had a way of knowing when something breaks as a result of some change? That would be pretty great. You could modify your code without having to worry about breaking anything, you'd have fewer bugs and you'd spend less time debugging.
That's where unit tests shine. They will automatically detect any problems in the code for you. Make a change, ...
Get Node.js: Related Tools & Skills now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.