O'Reilly logo

Test-Driven JavaScript Development by Harmeet Singh, Hetal Prajapati, Ravi Kumar Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Testing with Server-Side JS

Until now, we have been learning about testing the frontend part of a system. We learned many tools that could test the functions needed to support frontend, feature detection, and so on. In this chapter, we will learn about server-side testing for which we will be using Node.js and Mocha.

We will be covering the following topics in this chapter:

  • Setting up the environment
  • The server-side JavaScript testing

Setting up the environment

We have covered the simple unit test on the frontend JavaScript with different frameworks in our previous chapters. When it comes to unit testing the code on the server side, we mostly remain unaware of the order in which the functions will be called, we may either try to run the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required