For many years, JavaScript was known as a client-side language only. It used to run only within browsers. Once Node.js appeared, circa 2009, people started writing both the frontend and backend of their applications using JavaScript.
Node.js enabled an entirely new kind of JavaScript application and heavily contributed to shaping the JavaScript testing ecosystem. Because JavaScript developers were now able to implement different types of applications, they also had to come up with new ways of testing them and new tools for doing so.
In this chapter, I will focus on how to test the most notable kind of application that Node has enabled: backends written in JavaScript.
What you have already learned about organizing tests, assertions, and test doubles will still be crucial in this chapter. In it, you will learn the nuances associated with applying these techniques in the context of a server.