Major jasmine updates
This commit is contained in:
1033
lib/jasmine.js
1033
lib/jasmine.js
File diff suppressed because it is too large
Load Diff
@@ -4,28 +4,32 @@
|
||||
* result. Calling application can then do whatever it wants/needs with the string;
|
||||
*/
|
||||
Jasmine.Reporters.JSON = function () {
|
||||
var toJSON = function(object){
|
||||
return JSON.stringify(object);
|
||||
};
|
||||
var that = Jasmine.Reporters.reporter();
|
||||
that.specJSON = '';
|
||||
that.suiteJSON = '';
|
||||
that.runnerJSON = '';
|
||||
|
||||
var saveSpecResults = function (results) {
|
||||
that.specJSON = Object.toJSON(results);
|
||||
}
|
||||
that.specJSON = toJSON(results);
|
||||
};
|
||||
that.reportSpecResults = saveSpecResults;
|
||||
|
||||
var saveSuiteResults = function (results) {
|
||||
that.suiteJSON = Object.toJSON(results);
|
||||
}
|
||||
that.suiteJSON = toJSON(results);
|
||||
};
|
||||
that.reportSuiteResults = saveSuiteResults;
|
||||
|
||||
var saveRunnerResults = function (results) {
|
||||
that.runnerJSON = Object.toJSON(results);
|
||||
}
|
||||
that.runnerJSON = toJSON(results);
|
||||
};
|
||||
that.reportRunnerResults = saveRunnerResults;
|
||||
|
||||
that.toJSON = toJSON;
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
Jasmine.Reporters.domWriter = function (elementId) {
|
||||
var that = {
|
||||
@@ -36,12 +40,12 @@ Jasmine.Reporters.domWriter = function (elementId) {
|
||||
that.element.innerHTML += text;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
that.element.innerHTML = '';
|
||||
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
Jasmine.Reporters.JSONtoDOM = function (elementId) {
|
||||
var that = Jasmine.Reporters.JSON();
|
||||
@@ -49,10 +53,10 @@ Jasmine.Reporters.JSONtoDOM = function (elementId) {
|
||||
that.domWriter = Jasmine.Reporters.domWriter(elementId);
|
||||
|
||||
var writeRunnerResults = function (results) {
|
||||
that.domWriter.write(Object.toJSON(results));
|
||||
that.domWriter.write(that.toJSON(results));
|
||||
};
|
||||
|
||||
that.reportRunnerResults = writeRunnerResults;
|
||||
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user