Test 1 - Super test request

We're going to get started by creating our super test request. We're going to request something from the app express application; it is going to be a get request, that is, the URL we're testing, and the actual URL is going to be /todos/id, where id equals one of these _ids in todos. I'm going to go ahead and use the _id of the first todo. Down below we can fix this by changing our string to a template string, so we can inject _id, /todos/ then we're going to add our syntax for injecting a value into the template string. In this case we're accessing something from the todos array. We want to grab the first item, this is the first todo, and we're looking for its _id property. Now, this is an ObjectID; we need to ...

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.