node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »



A reporter for mocha to simplify the creation of JavaScript koans.

Heavily inspired by and modelled on the New Context Ruby Koans.



npm install -g mocha-koans-reporter


  1. Create a project for your koans with the following dependencies:
  1. Create a test directory to hold your koans.

  2. Create a test/mocha.opts file to specify default mocha running options with the following contents

    --reporter mocha-koans-reporter
    --require test/common
  3. Create a test/common.js file to specify global module dependencies across your koans, and set other defaults, e.g:

    global.chai = require('chai');
    global.expect = chai.expect;
    global.__ = "FILL ME IN";
  4. Create 1 or more test files in your test directory, e.g. test/about-truth.js:

    describe('truthiness', function() {
      it('is indeed true', function() {
  5. You can then run koans with mocha, or map npm test to this by adding this to your package.json:

    "scripts": {
      "test": "mocha"