diff --git a/benchmark/benchmark-bootstrap.coffee b/benchmark/benchmark-bootstrap.coffee index d6ba8d051..d4dff84fc 100644 --- a/benchmark/benchmark-bootstrap.coffee +++ b/benchmark/benchmark-bootstrap.coffee @@ -11,11 +11,10 @@ $('head').append $$ -> @link rel: "stylesheet", type: "text/css", href: "static/jasmine.css" $('body').append $$ -> - @div id: 'jasmine_runner' @div id: 'jasmine-content' jasmineEnv = jasmine.getEnv() -atomReporter = new jasmine.AtomReporter(document, 'jasmine_runner') +atomReporter = new jasmine.AtomReporter(document, false) jasmineEnv.addReporter(atomReporter) diff --git a/spec/spec-bootstrap.coffee b/spec/spec-bootstrap.coffee index 7d5a94769..772ac446c 100644 --- a/spec/spec-bootstrap.coffee +++ b/spec/spec-bootstrap.coffee @@ -11,11 +11,10 @@ $('head').append $$ -> @link rel: "stylesheet", type: "text/css", href: "static/jasmine.css" $('body').append $$ -> - @div id: 'jasmine_runner' @div id: 'jasmine-content' jasmineEnv = jasmine.getEnv() -atomReporter = new jasmine.AtomReporter(document, 'jasmine_runner') +atomReporter = new jasmine.AtomReporter(document) jasmineEnv.addReporter(atomReporter) diff --git a/vendor/jasmine-html.js b/vendor/jasmine-html.js index 0a0b43829..6614465dd 100644 --- a/vendor/jasmine-html.js +++ b/vendor/jasmine-html.js @@ -1,7 +1,7 @@ -jasmine.AtomReporter = function(doc) { +jasmine.AtomReporter = function(doc, logRunningSpecs) { this.document = doc || document; this.suiteDivs = {}; - this.logRunningSpecs = false; + this.logRunningSpecs = logRunningSpecs == false ? false : true; }; jasmine.AtomReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { @@ -91,8 +91,6 @@ jasmine.AtomReporter.prototype.reportRunnerResults = function(runner) { var results = runner.results(); var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); var specs = runner.specs(); var specCount = 0; for (var i = 0; i < specs.length; i++) { @@ -118,12 +116,6 @@ jasmine.AtomReporter.prototype.reportSuiteResults = function(suite) { this.suiteDivs[suite.id].className += " " + status; }; -jasmine.AtomReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - jasmine.AtomReporter.prototype.reportSpecResults = function(spec) { var results = spec.results(); var status = results.passed() ? 'passed' : 'failed'; @@ -148,9 +140,11 @@ jasmine.AtomReporter.prototype.reportSpecResults = function(spec) { messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); } else if (result.type == 'expect' && result.passed && !result.passed()) { messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); + if (this.logRunningSpecs) console.log(spec.getFullName()) if (result.trace.stack) { messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + if (this.logRunningSpecs) console.log(result.trace.stack) } } } @@ -162,17 +156,6 @@ jasmine.AtomReporter.prototype.reportSpecResults = function(spec) { this.suiteDivs[spec.suite.id].appendChild(specDiv); }; -jasmine.AtomReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - jasmine.AtomReporter.prototype.getLocation = function() { return this.document.location; };