2008-12-04 19:43:22 +00:00
|
|
|
JasmineReporters.JSON = function (elementId) {
|
2008-12-04 18:56:58 +00:00
|
|
|
var that = {
|
2008-12-04 19:43:22 +00:00
|
|
|
elementId: elementId,
|
2008-12-04 18:56:58 +00:00
|
|
|
results: {},
|
|
|
|
|
|
|
|
addResults: function (results) {
|
|
|
|
that.results = results;
|
|
|
|
},
|
|
|
|
|
|
|
|
report: function () {
|
2008-12-04 19:43:22 +00:00
|
|
|
var output = Object.toJSON(that.results);
|
|
|
|
|
|
|
|
if (that.elementId) {
|
|
|
|
var element = document.getElementById(that.elementId);
|
|
|
|
if (element) {
|
|
|
|
element.innerHTML = output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return output;
|
2008-12-04 18:56:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return that;
|
|
|
|
}
|
|
|
|
|
|
|
|
Jasmine.reporter = JasmineReporters.JSON();
|
|
|
|
|