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.

Introduction

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.