mocha-koans-reporter
A reporter for mocha to simplify the creation of JavaScript koans.
Heavily inspired by and modelled on the New Context Ruby Koans.
Pre-requisities
Install
npm install -g mocha-koans-reporter
Usage
- Create a project for your koans with the following dependencies:
-
Create a
test
directory to hold your koans. -
Create a
test/mocha.opts
file to specify default mocha running options with the following contents--reporter mocha-koans-reporter --require test/common --bail --recursive --watch
-
Create a
test/common.js
file to specify global module dependencies across your koans, and set other defaults, e.g:globalchai = ;globalexpect = chaiexpect;global__ = "FILL ME IN"; -
Create 1 or more test files in your
test
directory, e.g.test/about-truth.js
:; -
You can then run koans with
mocha
, or mapnpm test
to this by adding this to yourpackage.json
:"scripts":"test": "mocha"