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 ...

Get Test-Driven JavaScript 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.