mechamocha
v0.0.2
Published
Dump Mocha BDD.
Downloads
6
Readme
MechaMocha
THIS IS experimental
Mocha + node assert dumper by traverse JavaScript AST.
The reality is, I recommend use mocha's Doc reporter.
Installation
npm install mechamocha
Usage
Example test code :
"use strict";
var assert = require("power-assert");
describe('Array', function () {
describe('#indexOf()', function () {
it('should return -1 when the value is not present', function () {
assert.equal([1, 2, 3].indexOf(5), -1);
assert.equal([1, 2, 3].indexOf(0), -1);
});
it('should return -1 when the value is not present', function () {
assert.equal([1, 2, 3].indexOf(5), -1);
assert.equal([1, 2, 3].indexOf(0), -1);
})
});
});
describe('IsNaN', function () {
context("when value is NaN", function () {
it('should return true', function () {
assert(isNaN(NaN));
});
});
});
require("mechamocha")(code)
Generate following text form Above code .
Result :
Array
#indexOf()
should return -1 when the value is not present
[1, 2, 3].indexOf(5) equal -1
[1, 2, 3].indexOf(0) equal -1
should return -1 when the value is not present
[1, 2, 3].indexOf(5) equal -1
[1, 2, 3].indexOf(0) equal -1
IsNaN
when value is NaN
should return true
assert isNaN(NaN)
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT