This repository has been archived on 2022-07-06. You can view files and clone it, but cannot push or open issues or pull requests.
jasmine-junit-runner/src/test/javascript/lib/jasmine-1.0.2/jasmine.delegator_reporter.js

54 lines
1.3 KiB
JavaScript
Raw Normal View History

2011-06-24 21:11:58 +02:00
(function() {
if (!jasmine) {
throw new Exception("jasmine library does not exist in global namespace!");
}
/**
* Hooks up into the JUnit TestRunner system to allow Jasmine tests to run in Eclipse!
* Also sets a "done" flag on the spec itself since there is nothing like it in Jasmine
*/
var DelegatorJUnitReporter = function() {
this.javaReporter = jasmine.DelegatorJUnitReporter.javaReporter;
};
DelegatorJUnitReporter.prototype = {
reportRunnerStarting: function(runner) {
if(this.javaReporter) {
this.javaReporter.reportRunnerStarting(runner);
}
},
reportSpecStarting: function(spec) {
spec.done = false;
if(this.javaReporter) {
this.javaReporter.reportSpecStarting(spec);
}
},
reportSpecResults: function(spec) {
spec.done = true;
if(this.javaReporter) {
this.javaReporter.reportSpecResults(spec);
}
},
reportSuiteResults: function(suite) {
if(this.javaReporter) {
this.javaReporter.reportSuiteResults(suite);
}
},
reportRunnerResults: function(runner) {
if(this.javaReporter) {
this.javaReporter.reportRunnerResults(runner);
}
}
};
// export public
jasmine.DelegatorJUnitReporter = DelegatorJUnitReporter;
})();