From the course: JavaScript: Test-Driven Development (ES6)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Testing Node servers with SuperTest

Testing Node servers with SuperTest - JavaScript Tutorial

From the course: JavaScript: Test-Driven Development (ES6)

Start my 1-month free trial

Testing Node servers with SuperTest

- [Instructor] The first integration testing example we're going to look at here is testing routes on a Node server. We're going to use TDD to develop a simple Node server, and to do this, we're going to use a library called SuperTest. Now, I touched briefly on SuperTest in a previous video. It's a very useful testing library that lets us test the functionality of a Node server without actually starting it up, which saves us a lot of time when running our tests. So let's take a look at how to do this. The first thing you'll want to do is open up a code editor. I personally use VS Code. And create a new directory. We're going to call it tdd-server. Or you can call it whatever else you want. And next we're going to open up a terminal. I'm going to use VS Code's built-in terminal here. And make sure we're in the directory that we just created. And now we've got to do the same setup that we did for our unit test demonstration in…

Contents