diff --git a/Rakefile b/Rakefile index bcadfe1..64d7cdb 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,7 @@ desc 'Builds lib/jasmine from source' task :build do # these files must be better - sources = ["src/base.js", "src/util.js", "src/Env.js"] + sources = ["src/base.js", "src/util.js", "src/Env.js", "src/ActionCollection.js", "src/Reporter.js"] sources += Dir.glob('src/*.js').reject{|f| sources.include?(f)} diff --git a/lib/jasmine.js b/lib/jasmine.js index bb44280..41dbad1 100644 --- a/lib/jasmine.js +++ b/lib/jasmine.js @@ -569,7 +569,8 @@ jasmine.util.argsToArray = function(args) { /** * Environment for Jasmine - * @ + * + * @constructor */ jasmine.Env = function() { this.currentSpec = null; @@ -597,7 +598,7 @@ jasmine.Env.prototype.clearInterval = jasmine.clearInterval; /** * Register a reporter to receive status updates from Jasmine. - * @param {Object} reporter An object which will receive status updates. + * @param {jasmine.Reporter} reporter An object which will receive status updates. */ jasmine.Env.prototype.addReporter = function(reporter) { this.reporter.addReporter(reporter); @@ -844,6 +845,29 @@ jasmine.ActionCollection.prototype.waitForDone = function(action) { } }, 150); }; +/** No-op base class for Jasmine reporters. + * + * @constructor + */ +jasmine.Reporter = function() { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerResults = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecResults = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.log = function (str) { +}; + jasmine.Matchers = function(env, actual, results) { this.env = env; this.actual = actual; @@ -1280,6 +1304,7 @@ window.clearInterval = function(timeoutKey) { jasmine.MultiReporter = function() { this.subReporters_ = []; }; +jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); jasmine.MultiReporter.prototype.addReporter = function(reporter) { this.subReporters_.push(reporter); diff --git a/spec/runner.html b/spec/runner.html index e09e0ad..41c87bd 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -10,6 +10,7 @@ + @@ -22,11 +23,11 @@ -