Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework
Unit Testing
| Intermediate
- 13 Videos | 1h 9m 18s
- Includes Assessment
- Earns a Badge
Explore how to use JS (Javascript) Mocha, the most popular unit testing framework to run unit tests, in this 13-video course, which examines different hooks that Mocha.js provides to run the test suites. First, learners will examine specific testing environments using the Mocha before and beforeEach hooks. You will then learn how to tear down these test environments, after the completion of the tests, by using the after and afterEach hooks. You will learn how to write tests for asynchronous functions by using the done method, and how to use Async awake keywords. You will learn to use the async/await methods to test asynchronous code that return promises. This course then demonstrates how to set up a simple HTTP server to run Mocha tests in a browser environment. Finally, you will learn how to use the Mocha command line to run multiple tests and how to select a specific test to run by using regular expressions.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courserecognize the use of the before() and after() hooks in testsrecognize the use of the beforeEach() and afterEach() hooks in testsimplement tests using multiple hooksrecall why the use of the arrow functions should be avoided in Mochause the done() method to signal test completionset up asynchronous test functions
-
perform asynchronous testing using async/awaitprepare Mocha tests to run within a browserrun Mocha tests in a browserconfigure different reporters in Mocharun multiple tests from the command linesummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 4sUP NEXT
-
2.Before and After Hooks10m 10s
-
3.Before Each and After Each Hooks3m 57s
-
4.Bringing All Hooks Together4m 55s
-
5.Arrow Functions for Mocha Tests6m 7s
-
6.Asynchronous Testing Using Done7m 8s
-
7.Setting up Async Utilities4m 51s
-
8.Asynchronous Testing Using Async/Await6m 34s
-
9.Setting up Mocha Tests in the Browser8m 12s
-
10.Running Mocha Tests in the Browser4m 29s
-
11.Configuring Mocha Reporters3m 40s
-
12.Running Multiple Tests5m 58s
-
13.Course Summary1m 12s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.