How should I test my code?
Due to the history of JavaScript, most developers didn’t have the culture of testing their code while JavaScript was limited to the browser and used almost exclusively to build relatively simple scripts.
However, with the evolution of the language and the community, we now have a lot of tools and frameworks to help us build tests.
Frameworks and libraries
When you have a clear idea of how to test your code, you can easily migrate from one tool to another until you find the one that fits your needs best.
In this chapter, we will explore the promising Node.js test core library and the most popular test framework for web development, Jest.
Important note
We are living in a transitional period where the Node.js core library is evolving to provide a better experience to developers. So, probably in the future, it will be the default tool to use. But for now, if you are new to testing, I recommend you use Jest because there are more tutorials...