Unit Testing in JavaScript: Mocha & Unit.js

Unit Testing
  • 15 Videos | 1h 53m 1s
  • Includes Assessment
  • Earns a Badge
Likes 5 Likes 5
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

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.

YOU MIGHT ALSO LIKE