The video for this lesson is currently being updated, please read the transcript instead.

Sad path tests

In the tests we've written so far, we've only tested what's known as the "happy path", in other words we've been writing tests based on everything going right.

But what happens if we supply eronous data? It's important that we know our error handling is working.

GET /items/:id

Let's start by adding two more test cases to our GET /items/:id suite.

Since these are fairly simple to create, I'll show you the finished code and go through the explanation.

To view the complete lesson you'll need to login or join this course.


Click to load comments...