If you haven't already done so, duplicate the source tree to use in this chapter. For example, if you had a directory named chap10, create one named chap11 containing everything from chap10.
In the notes directory, create a new directory named test.
Mocha (http://mochajs.org/) is one of many test frameworks available for Node.js. As you'll see shortly, it helps us write test cases and test suites, and it provides a test results reporting mechanism. It was chosen over the alternatives because it supports Promises. It fits very well with the Chai assertion library mentioned earlier. And, we'll need to use ES6 modules from test suites written in CommonJS, and therefore we must use the esm module.
You may find references to an earlier @std/esm module. That module has been deprecated, with esm put in its place.
While in the notes/test directory, type this to install Mocha, Chai, and esm:
$ npm init
... answer the questions to create package.json
$ npm install mocha@5.x chai@4.1.x esm --save