dwf/rva: added JSONReporter

This commit is contained in:
pivotal
2008-12-04 10:56:58 -08:00
parent 735ebd6c66
commit cc164257a7
5 changed files with 130 additions and 63 deletions
+10
View File
@@ -279,14 +279,24 @@ var Runner = function () {
that.suites = that.actions;
that.results.description = 'All Jasmine Suites';
that.finishCallback = function () {
if (that.reporter) {
that.reporter.addResults(that.results);
that.reporter.report();
}
}
Jasmine = that;
return that;
}
var JasmineReporters = {};
var Jasmine = Runner();
var currentSuite;
var currentSpec;
/*
* TODO:
//* - add spec or description to results
+17
View File
@@ -0,0 +1,17 @@
JasmineReporters.JSON = function () {
var that = {
results: {},
addResults: function (results) {
that.results = results;
},
report: function () {
return Object.toJSON(that.results);
}
}
return that;
}
Jasmine.reporter = JasmineReporters.JSON();