Running the getUser object test

To actually run this, we're going to head over into the Terminal and make sure we do get the expected results. I'm going to be using nodemon to get that done. If you just updated Node, it also updated npm and, at the end of the day, what that means is that you no longer have access to those global modules. You might need to rerun npm install -g nodemon before you can use the nodemon command. I'm going to use nodemon running the app-promises.js file and, right here, we have our output:

We have Jessica printing with a schoolId of 999 and an id of 2. That is because I passed 2 in getUser id:

getUser(2).then((user) ...

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.