Chapter 6

Code Quality

Learning Objectives

By the end of this chapter, you will be able to:

  • Identify the best practices for writing clean JavaScript code
  • Perform linting and add a lint command to your node project
  • Use unit, integration, and end-to-end testing methods on your code
  • Automate linting and tests using Git hooks

In this chapter, we will focus on improving code quality, setting up tests, and automating tests to run before a Git commit. These techniques can be used to ensure that mistakes or errors are found early on and never make it to production.


In the previous chapter, we explored the concepts of modular design, ES6 modules, and their use with Node.js. We took our compiled ES6 JavaScript and converted it into ...

Get Professional JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.