First, install Node.js, if you don’t have it.
Then, run
$ npm install
in the repository directory.
You can confirm it’s working by running:
$ npm test
This primer uses Mocha. The project website has good and consice documentation about how it works.
Asserts are done via the better-assert library, which is very straight-forward, just pass a boolean value.
The game of life code is short enough so that it’s fine if we write both the code and the tests in the same file.
$ npm test
Deleting code is hard on the mind, but not hard on the console. Just run:
$ npm run-script reset
WARNING: This will permanently delete all modifications after the previous commit.