Summary
In this chapter, we learned about the testing principles and how we can combine different types of tests to build a robust test suite. We also explored how the test pyramid can help us to build a test suite that is easy to maintain and understand.
Additionally, we discussed the differences between unit tests and integration tests and how we can use them to test our code. We also explored strategies to evangelize testing in our teams.
After that, we explored how to add unit tests to our code using Node.js core modules and Jest.
Finally, we learned how to use code coverage as an interactive tool to help us refine our tests and keep our code base robust. Then, we did a little exercise using TDD to fix a bug in our library.
In the next chapter, we will explore how the HTTP protocol works in detail and how we can build RESTful APIs with Node.js.