The Node community has embraced testing from the beginning, and many testing frameworks and native tools are made available to developers. In this chapter, we examined why testing is so important to modern software development as well as something about functional, unit, and integration testing, what they are, and how they can be used. With the vm module, we learned how to create special contexts for testing JavaScript programs, and picking up some techniques for sandboxing untrusted code along the way.
In addition, we learned how to work with the extensive set of Node testing and error-handling tools, from more expressive console logging to Mocha and mocking with Sinon, onto one line tracing and debugging heaps and live code. Finally, we learned about two different headless browser testing libraries, learning two ways in which such testing might be done in each, and how...