Unit Testing in JavaScript: Mocha & Unit.js

Unit Testing    |    Intermediate
  • 15 videos | 1h 46m 31s
  • Includes Assessment
  • Earns a Badge
Rating 4.3 of 4 users Rating 4.3 of 4 users (4)
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.

WHAT YOU WILL LEARN

  • 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

IN THIS COURSE

  • 2m 8s
  • 10m 1s
    In this video, you will learn how to install and configure the Mocha testing environment. FREE ACCESS
  • Locked
    3.  Installing Unit.js
    7m 27s
    During this video, you will learn how to install the Unit.js assertion library. FREE ACCESS
  • Locked
    4.  Testing Booleans
    8m 31s
    In this video, find out how to use assertions to test for boolean values. FREE ACCESS
  • Locked
    5.  Testing Strings
    5m 50s
    During this video, you will learn how to use assertions to test for strings. FREE ACCESS
  • Locked
    6.  Testing Strings with Match
    6m 54s
    In this video, you will learn how to match strings using regular expressions and custom functions. FREE ACCESS
  • Locked
    7.  Testing Numbers
    9m 59s
    Learn how to compare numeric values in tests. FREE ACCESS
  • Locked
    8.  Testing Functions
    5m 21s
    Find out how to use assertions to test function objects. FREE ACCESS
  • Locked
    9.  Testing Arrays
    10m 6s
    In this video, find out how to work with arrays and array elements. FREE ACCESS
  • Locked
    10.  Testing Objects Using Equality Comparisons
    6m 29s
    In this video, you will compare objects using equality operators. FREE ACCESS
  • Locked
    11.  Testing Objects Using Match
    7m 38s
    Learn how to test objects using a match. FREE ACCESS
  • Locked
    12.  Testing Objects Using Instance Of
    3m 48s
    To find out how to determine if an object is an instance of another object, consult a Java reference guide. FREE ACCESS
  • Locked
    13.  Testing Exceptions
    10m 23s
    In this video, learn how to summarize the different ways to test for errors. FREE ACCESS
  • Locked
    14.  Testing Values
    10m 47s
    After completing this video, you will be able to describe how values of different data types can be compared. FREE ACCESS
  • Locked
    15.  Course Summary
    1m 11s
    In 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.

YOU MIGHT ALSO LIKE

Rating 4.6 of 5 users Rating 4.6 of 5 users (5)
Rating 4.6 of 171 users Rating 4.6 of 171 users (171)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.3 of 16 users Rating 4.3 of 16 users (16)
Rating 4.7 of 12 users Rating 4.7 of 12 users (12)
Rating 4.3 of 1115 users Rating 4.3 of 1115 users (1115)