Unit Testing in JavaScript: Mocha & Chai

Unit Testing    |    Intermediate
  • 12 videos | 57m 34s
  • Includes Assessment
  • Earns a Badge
Rating 5.0 of 6 users Rating 5.0 of 6 users (6)
This 12-video course offers a detailed exploration of the Chai assertion framework, an assertion library available in JS (Javascript) to perform unit testing. In this course, you will learn how to install and set up the Chai assertion library on your computer, and learn to use two kinds of application programming interfaces (APIs) that Chai offers for assertions. Learners will examine Chai APIs for both test-driven development and behavior-driven development, and will write unit tests by using the classic API. Learn to use the classic assertion API as well as the Should and Expect API in Chai to test numbers, Booleans, strings, objects and object properties, and arrays. Explore how to use Should to chain multiple assertions together. Then learn how to run tests on simple data types, including Boolean strings and numbers, and on complex data types such as arrays and objects, all using Chai, and examine behavior-driven development by using the Should and Expect APIs. This course compares test-driven development and behavior-driven development. Finally, explore the Expect API.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Install the chai library on your local machine
    Use assertions to test boolean values
    Compare numeric values using assert
    Performing string comparisons using assert
    Describe the assertions that can be used to test objects and their properties
  • Use arrays and elements in arrays using assert
    Compare and contrast the should and expect apis in chai
    Test different data types using should
    Test different data types using expect
    Perform asynchronous function testing using expect
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 7s
  • 3m 51s
    In this video, you will install the Chai library on your local machine. FREE ACCESS
  • Locked
    3.  Testing Booleans with Assert
    7m 35s
    In this video, you will use assertions to test boolean values. FREE ACCESS
  • Locked
    4.  Testing Numbers with Assert
    8m 6s
    In this video, learn how to compare numeric values using the assert keyword. FREE ACCESS
  • Locked
    5.  Testing Strings with Assert
    3m 4s
    In this video, you will learn how to perform string comparisons using assert. FREE ACCESS
  • Locked
    6.  Testing Objects with Assert
    9m
    After completing this video, you will be able to describe assertions that can be used to test objects and their properties. FREE ACCESS
  • Locked
    7.  Testing Arrays with Assert
    1m 53s
    In this video, you will learn how to use arrays and elements in arrays using assertions. FREE ACCESS
  • Locked
    8.  Should and Expect in Chai
    4m 26s
    In this video, learn how to compare and contrast the should and expect APIs in Chai. FREE ACCESS
  • Locked
    9.  Testing Numbers, Booleans, and Arrays with Should
    3m 49s
    In this video, you will learn how to test different data types using the "should" command. FREE ACCESS
  • Locked
    10.  Testing Strings, Arrays, and Objects with Expect
    6m 7s
    In this video, find out how to test different data types using the expect function. FREE ACCESS
  • Locked
    11.  Testing Asynchronous Operations with Expect
    6m 18s
    In this video, learn how to perform asynchronous function testing using the expect function. FREE ACCESS
  • Locked
    12.  Course Summary
    1m 18s
    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.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 67 users Rating 4.4 of 67 users (67)
Rating 4.4 of 657 users Rating 4.4 of 657 users (657)
Rating 4.6 of 66 users Rating 4.6 of 66 users (66)