Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework

Unit Testing
  • 13 Videos | 1h 14m 48s
  • Includes Assessment
  • Earns a Badge
Likes 9 Likes 9
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 course
    recognize the use of the before() and after() hooks in tests
    recognize the use of the beforeEach() and afterEach() hooks in tests
    implement tests using multiple hooks
    recall why the use of the arrow functions should be avoided in Mocha
    use the done() method to signal test completion
    set up asynchronous test functions
  • perform asynchronous testing using async/await
    prepare Mocha tests to run within a browser
    run Mocha tests in a browser
    configure different reporters in Mocha
    run multiple tests from the command line
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 4s
    UP NEXT
  • Playable
    2. 
    Before and After Hooks
    10m 10s
  • Locked
    3. 
    Before Each and After Each Hooks
    3m 57s
  • Locked
    4. 
    Bringing All Hooks Together
    4m 55s
  • Locked
    5. 
    Arrow Functions for Mocha Tests
    6m 7s
  • Locked
    6. 
    Asynchronous Testing Using Done
    7m 8s
  • Locked
    7. 
    Setting up Async Utilities
    4m 51s
  • Locked
    8. 
    Asynchronous Testing Using Async/Await
    6m 34s
  • Locked
    9. 
    Setting up Mocha Tests in the Browser
    8m 12s
  • Locked
    10. 
    Running Mocha Tests in the Browser
    4m 29s
  • Locked
    11. 
    Configuring Mocha Reporters
    3m 40s
  • Locked
    12. 
    Running Multiple Tests
    5m 58s
  • Locked
    13. 
    Course Summary
    1m 12s

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

Likes 7 Likes 7  
Likes 11 Likes 11  
Likes 10 Likes 10