Testing JavaScript for Node.js with Mocha

Mocha is one of the most popular and robust testing frameworks for JavaScript. In this course, you'll be introduced to Mocha and learn how to build a robust test suite against your node.js applications.
Course info
Rating
(47)
Level
Intermediate
Updated
May 4, 2017
Duration
2h 28m
Table of contents
Description
Course info
Rating
(47)
Level
Intermediate
Updated
May 4, 2017
Duration
2h 28m
Description

Building good and comprehensive tests for your JavaScript applications helps enable stable and robust applications. Good tests also serve as valuable documentation for what your applications are actually supposed to be doing. In this course, Testing JavaScript for Node.js with Mocha, you'll dive deep into Mocha, one of the most popular and robust testing frameworks for JavaScript. First, you'll start by learning the ins and outs of testing with Mocha. Next, you'll explore how to implement a BDD style of assertion language with Chai. Finally, you'll cover the right way to mock objects and functions with Sinon, and you'll develop an understanding of how to track your code coverage with Istanbul. By the end of this course, you'll be able to build a robust test suite against your node.js applications.

About the author
About the author

Jonathan Mills is a JavaScript and Node.js expert working mostly in the MEAN Stack with individuals and companies to help build their technical skills to cope with the constantly changing landscape of software development. He is also an ASP.NET insider and an international speaker focusing on JavaScript both in the browser and on the server.

More from the author
Advanced AngularJS Workflows
Advanced
1h 31m
9 Nov 2016
Using ES6 in Your Node.js Web Application
Intermediate
1h 44m
10 Aug 2016
JavaScript Best Practices
Intermediate
2h 39m
5 Apr 2016
More courses by Jonathan Mills
Transcript
Transcript

Hi everyone, my name is Jonathan Mills and welcome to my course “JavaScript Testing for Node.js with Mocha.”

I am a consultant dealing with JavaScript and one thing I notice with JavaScript developers is everyone says we should be testing our code, but not as many people actually do it. I think part of the reason for that is that getting tests set up and going is not easy. There are lots of moving parts and it is just one more thing to learn.

In this course, we are going to simplify that process and break it down to the minimum parts to get testing going.

We will start with a dive into Mocha. Make sure we understand how that works. We will add in Assertion and Mocking frameworks make testing easier. And then we will pull that all together and test a real application.

By the end of this course be able to set up tests for your own application. Before beginning the course you should be familiar with Node.js and JavaScript.