Refactored into class files. Meta-tests and runner for jasmine. Stack traces available for Firefox and supported browsers. Experimental pretty print matcher support. Many other new features

This commit is contained in:
ragaskar
2009-05-28 20:02:15 -07:00
parent cabc666505
commit 9d95483de6
29 changed files with 3249 additions and 1717 deletions

49
src/NestedResults.js Normal file
View File

@@ -0,0 +1,49 @@
/**
* Holds results; allows for the results array to hold another jasmine.NestedResults
*
* @constructor
*/
jasmine.NestedResults = function() {
this.totalCount = 0;
this.passedCount = 0;
this.failedCount = 0;
this.skipped = false;
this.items_ = [];
};
jasmine.NestedResults.prototype.rollupCounts = function(result) {
this.totalCount += result.totalCount;
this.passedCount += result.passedCount;
this.failedCount += result.failedCount;
};
jasmine.NestedResults.prototype.log = function(message) {
this.items_.push(new jasmine.MessageResult(message));
};
jasmine.NestedResults.prototype.getItems = function() {
return this.items_;
};
/**
* @param {jasmine.ExpectationResult|jasmine.NestedResults} result
*/
jasmine.NestedResults.prototype.addResult = function(result) {
if (result.type != 'MessageResult') {
if (result.items_) {
this.rollupCounts(result);
} else {
this.totalCount++;
if (result.passed) {
this.passedCount++;
} else {
this.failedCount++;
}
}
}
this.items_.push(result);
};
jasmine.NestedResults.prototype.passed = function() {
return this.passedCount === this.totalCount;
};