Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/froots/mocha-koans-reporter
A Mocha reporter to allow creation of JavaScript koans for learning enlightenment
https://github.com/froots/mocha-koans-reporter
Last synced: 2 months ago
JSON representation
A Mocha reporter to allow creation of JavaScript koans for learning enlightenment
- Host: GitHub
- URL: https://github.com/froots/mocha-koans-reporter
- Owner: froots
- License: wtfpl
- Created: 2012-10-13T16:42:39.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-12-15T05:02:35.000Z (about 7 years ago)
- Last Synced: 2024-11-03T19:51:32.506Z (3 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
mocha-koans-reporter
====================A reporter for [mocha](http://visionmedia.github.com/mocha/) to simplify the creation of JavaScript koans.
Heavily inspired by and modelled on the [New Context Ruby Koans](http://rubykoans.com/).
Pre-requisities
---------------* [Node.js](http://nodejs.org/)
* [NPM](https://npmjs.org/)Install
-------npm install -g mocha-koans-reporter
Usage
-----1. Create a project for your koans with the following dependencies:
* [Mocha](http://visionmedia.github.com/mocha/)
* [Chai](http://chaijs.com/) or another assertion library
1. Create a `test` directory to hold your koans.
1. 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
```1. Create a `test/common.js` file to specify global module dependencies across your koans, and set other defaults, e.g:
```javascript
global.chai = require('chai');
global.expect = chai.expect;
global.__ = "FILL ME IN";
```1. Create 1 or more test files in your `test` directory, e.g. `test/about-truth.js`:
```javascript
describe('truthiness', function() {
it('is indeed true', function() {
expect(true).to.equal(__);
});
});
```1. You can then run koans with `mocha`, or map `npm test` to this by adding this to your `package.json`:
```javascript
"scripts": {
"test": "mocha"
}
```