In this chapter, we've looked at testing in Node and hapi, and how testing as well as code coverage are paramount in the hapi ecosystem. We've seen justification for their needs in application development, and how they can make us a more productive developer.
We've also introduced the test runner and code assertion libraries lab and code in the ecosystem and justified their use. You've learnt how to use them for writing simple tests, and how to use the tools provided in lab and hapi to test hapi applications.
You've also learned of some of the extra features baked into lab such as code coverage and linting. We looked at testing the code coverage of an application and getting it to 100%, and explained how the hapi ecosystem applies the hapi style guide to all the modules using the linting integration inlab
.
As always, all code samples seen here as well as some extra material can be found online in the repository available at https://github.com/johnbrett/Getting-Started-with-hapi.js.
However...