Test case 4 - should return 404 if todo not found

I'm going to copy the should return 404 test case for the should return 404 if todo not found test, and we're going to paste that into the exact same test for the delete route, and all we have to do is change .get to .delete, and save the file. This is going to rerun the test suite, and now we have two tests under delete; they are both passing:

You can see our last test still fails, so we can go ahead and do the same thing. I'm going to copy the code from should return 404 for non-object ids, which verifies that non-ObjectIDs cause a 404 status code. I'm going to paste it in the last test case, ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.