Category: mocha

Debugging JavaScript Projects with VS Code & Chrome Debugger

Debugging JavaScript isn’t the most fun aspect of JavaScript programming, but it’s a vital skill. This article covers two tools that will help you debug JavaScript like a pro. Imagine for a moment that the console.log() function did not exist in JavaScript. I’m pretty sure the first question you’...

Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs

This article was peer reviewed by Mark Brown and MarcTowler. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! One of the biggest stumbling blocks when writing unit tests is what to do when you have code that’s non-trivial. [author_more] In real life projects, code...

Unit Test Your JavaScript Using Mocha and Chai

This article was peer reviewed by Panayiotis «pvgr» Velisarakos, and Tom Greco. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! 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 al...