Test for HTTP 400 responses with Mocha and Chai

Will Button
InstructorWill Button

Share this video with your friends

Send Tweet

In this lesson, you will learn how to verify your API server is returning HTTP 400 responses when clients submit incorrect data. Returning HTTP 400 ensures that your clients are notified of the incorrect usage. Testing for them ensures your API returns errors instead of incorrect responses when supplied with incorrect data.