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
-
2m 4s
-
10m 10sUpon completion of this video, you will be able to recognize the use of the before and after hooks in tests. FREE ACCESS
-
3m 57sUpon completion of this video, you will be able to recognize the use of the beforeEach() and afterEach() hooks in tests. FREE ACCESS
-
4m 55sIn this video, you will learn how to implement tests using multiple test hooks. FREE ACCESS
-
6m 7sUpon completion of this video, you will be able to recall why the use of arrow functions should be avoided in Mocha. FREE ACCESS
-
7m 8sFind out how to use the done() method to signal the completion of a test. FREE ACCESS
-
4m 51sIn this video, you will learn how to set up asynchronous test functions. FREE ACCESS
-
6m 34sIn this video, learn how to perform asynchronous testing using the async/await keywords. FREE ACCESS
-
8m 12sFind out how to prepare Mocha tests to run in a browser. FREE ACCESS
-
4m 29sLearn how to run Mocha tests in a browser. FREE ACCESS
-
3m 40sFind out how to configure different reporters in Mocha. FREE ACCESS
-
5m 58sIn this video, you will run multiple tests from the command line. FREE ACCESS
-
1m 12sIn this video, we will summarize the key concepts covered in this course. FREE ACCESS
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.