Isolating existing code for testing


show more Isolating existing code for testing provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Node.js Essential Training (2013) show less
please wait ...

Isolating existing code for testing

When you're approaching an existing application to unit test it for the first time, you may find certain pieces are tied together in such a way that you can't write effective tests. In this video, we'll look at our existing express application and find ways to decouple some of the code. Let's go to the exercise files first. Go to chapter six, video two and copy the start folder to the desktop. Now let's go there and install the dependencies in terminal. I'm going to type cd, and then drag the path in, then I'm going to do npm install and press Return.

Now that the dependencies have been installed, let's have a look at the code. I'm going to drag the start folder into sublime text. So first let's take a look at routes, index.js. We have a problem here on line six. These route handling functions are specifically tied to the set of data, that's here on line six. We also have another problem. Let's go to app.js, and at the bottom of the page, we are creating an ...

Isolating existing code for testing
Video duration: 6m 47s 3h 17m Intermediate

Viewers:

Isolating existing code for testing provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Node.js Essential Training (2013)

Subject:
Developer
Software:
JavaScript Node.js
Author:
please wait ...