Node Mocha Reporter
A mocha reporter not tied to STDOUT that provides tests results in a
json object.
Usage
var Mocha = require('mocha');
var NodeMochaReporter = require('node-mocha-reporter');
var mocha = new Mocha({ reporter: NodeMochaReporter });
mocha.addFile('path/to/my/test.js');
mocha.run(function(report) {
});
Report format
{
passed: [{
description: String,
suite: [String],
success: Boolean,
skipped: Boolean,
duration: Number,
testBody: String,
error: String
}],
failed: [{
description: String,
suite: [String],
success: Boolean,
skipped: Boolean,
duration: Number,
testBody: String,
error: String
}],
skipped: [{
description: String,
suite: [String],
success: Boolean,
skipped: Boolean,
duration: Number,
testBody: String,
error: String
}]
}