I'm going to call request, passing in app, then I'm going to go ahead and call get, setting up the URL. We don't need to use template strings here since we're just going to be passing in a plain string, /todos/123abc. Indeed an invalid ObjectID. The ObjectIDs, as we talked about, have a very specific structure and this does not pass that criteria. To find out more about ObjectIDs you can always go back to the ObjectID section at the beginning of this chapter. Next, we're going to start setting up our assertions by calling expect and expecting 404 to come back, and we can wrap this test up by calling the end method and passing in done:
it('should return 404 for non-object ids', (done) => {
request(app)
.get('/todos/123abc')
.expect(404)
.end(done);
});
With this in place, our test suite for GET /todos/:id is complete. Over in the Terminal it just reran and all of the test cases passed, and this is fantastic:

We now have a complete test suite set up for the route, which means we are done, and if the data comes back incorrectly, for example, if the body data has an extra character appended like the character 1, the test cases are going to fail. Everything is working really, really well.
The last thing left to do is commit our changes. Over inside the Terminal I'm going to shut down nodemon and run git status. Here are the only changes we have are our changes to the server.test file, which is a modified file—git is already tracking it, which means I can use git commit with the -a or -m flag or the combined -am flag, providing a message, Add test cases for GET /todos/:id:
git commit -am 'Add test cases for GET /todos/:id'
I'm going to make the commit and push it up to GitHub. In the next section, we're going to switch things up a little bit. Instead of continuing on, adding new routes, which we will do a little later, we are going to deploy our application to Heroku using a real-world MongoDB database. That means all the calls we're making in Postman we can make to a real server, and anybody can make those calls, not just people on our local machine, because the URL will no longer be on the localhost.