Unit Testing in JavaScript: Mocha & Unit.js


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description

Unit testing on software development paradigms, the support testing provided, and the assertion libraries available in JS (Javascript) are explored in this 15-video course. First, you will learn to use the Node.js environment on your local machine and use the NPM package manager to install Mocha and Unit.js. Learners will then study the functionality of Mocha, and how to build suites of tests. You will also learn how to use Sinon to construct spies, stubs, and mocks, and how it works with Mocha. Continue by learning how to use the Unit.js assertion library to test your code. This course examines the various assertions that Unit.js offers to test simple data types, such as Booleans, numbers, and strings. You will learn how to test more complex data types, including functions and arrays, and to test the objects. You will also learn how to check individual properties of an object by using custom functions as well as regular expressions. Finally, examine unit testing of functions that throw several kinds of errors.



Expected Duration (hours)
1.8

Lesson Objectives

Unit Testing in JavaScript: Mocha & Unit.js

  • discover the key concepts covered in this course
  • install and configure the Mocha testing environment
  • install the Unit.js assertion library
  • use assertions to test boolean values
  • use assertions to test strings
  • match strings using regular expressions and custom functions
  • compare numeric values in tests
  • use assertions to test function objects
  • work with arrays and array elements
  • compare objects using equality operations
  • test objects using match
  • determine whether objects are instances of other objects
  • summarize the different ways to test errors
  • describe how values of different data types can be tested
  • summarize the key concepts covered in this course
  • Course Number:
    it_aputjsdj_01_enus

    Expertise Level
    Intermediate