dwf/rva: adding optional element for DOM output
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
JasmineReporters.JSON = function () {
|
||||
JasmineReporters.JSON = function (elementId) {
|
||||
var that = {
|
||||
elementId: elementId,
|
||||
results: {},
|
||||
|
||||
addResults: function (results) {
|
||||
@@ -7,7 +8,15 @@ JasmineReporters.JSON = function () {
|
||||
},
|
||||
|
||||
report: function () {
|
||||
return Object.toJSON(that.results);
|
||||
var output = Object.toJSON(that.results);
|
||||
|
||||
if (that.elementId) {
|
||||
var element = document.getElementById(that.elementId);
|
||||
if (element) {
|
||||
element.innerHTML = output;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
return that;
|
||||
|
||||
Reference in New Issue
Block a user