Lesson

Test Node RESTful API with Mocha and Chai

In this lesson, we will use Chai's request method to test our Node application's API responses. By the end of this lesson, you will know how to: - install the prerequisites to use mocha and chai in your application - test for HTTP status response codes - test...

Duration
12 min
Access
Free
Transcript
Available

In this lesson, we will use Chai's request method to test our Node application's API responses. By the end of this lesson, you will know how to:

  • install the prerequisites to use mocha and chai in your application
  • test for HTTP status response codes
  • test for a string of text on a page
  • test for a json response and validate the properties of the object
  • write tests that not only verify the response of your application, but the behavior as well