March 2018
Intermediate to advanced
592 pages
13h 44m
English
Next up, it('should return 404 if todo not found'). If we try to delete the Todo but nothing was actually deleted, we're going to send a 404 status code back so the user knows that the call probably didn't work as expected. Yes, the call didn't necessarily fail, but you never deleted the item you wanted to delete, so we are going to consider that a failure, and that's what we did when we sent the 404 status code back:
describe('DELETE /todos/:id', () => {
it('should remove a todo', (done) => {
});
it('should return 404 if todo not found', (done) => {
});
});