Learn JavaScript Unit Testing
Why Learn JavaScript Unit Testing?
Tests are essential for programmers! Errors in software are inevitable and costly. Testing enables programmers to catch more of their own bugs before deploying their code. Testing is so important that some developers write tests before anything else, in a methodology known as test-driven development.
Take-Away Skills:
You will learn the fundamentals of test-driven development, and the popular JavaScript testing library, Mocha. This course focuses on unit tests, which are the smallest and most specific types of software tests. After this course, you’ll be ready to test larger software features with the course Learn Testing for Web Development.
Note on Prerequisites:
Intermediate JavaScript is a prerequisite for this course. You should be comfortable with programming fundamentals, control flow, arrays, objects, and functions.
Built in partnership with
- 1Learn the benefits of software testing and the terminology to explain them.
- 2Learn to use the Mocha framework and the Node.js assert library to write, automate, and organize tests in Javascript.
- 3Learners will practice test driven development to create their own JavaScript testing suite using Mocha.js.
What you'll create
Portfolio projects that showcase your new skills
Cake O'Clock
Test and fix Cake Bar's new pick up feature
Rooster Regulation
It's time to build fluency in JavaScript testing. In this next Pro Project, we're going to practice using describe, it, and assert in Mocha so you can hone your skills and feel confident taking them to the real world. Why? Practicing how to use describe, it and assert will allow you to create tests that will make your webpages bulletproof. What's next? A loud rooster, making sure you wake up at the right time, more Mocha. You got this!
Factorial Feature
It's time to build fluency in JavaScript testing. In this next Pro Project, we're going to practice setup, exercise, and verify in Mocha so you can hone your skills and feel confident taking them to the real world. Why? You'll learn three steps to guide you in writing perfect tests. What's next? Middle school math you probably forgot, edge cases, more Mocha. You got this!
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory

— Madelyn, Pinterest
I know from first-hand experience that you can go in knowing zero, nothing, and just get a grasp on everything as you go and start building right away.
Course Description
Learn to write unit tests in JavaScript with Mocha.
Details
Earn a certificate of completion
6 hours to complete in total
Intermediate
Learn the benefits of software testing and the terminology to explain them.
2 lessons, 1 project, 1 quiz
1 lesson, 1 project, 1 quiz