Error Cases

Learn how to test error cases.

We'll cover the following

Testing error cases

Every test we’ve written until now has been focused on success cases. Now let’s look at the places where our test case might not pass due to incorrect input data. Since we want to test different functionality in separate tests, let’s choose the malformed weather data.

Let’s add a new test inside the same describe block, but this time, it’s an “error” test:

Get hands-on with 1200+ tech skills courses.