Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Don't die if browser didn't start
Browse files Browse the repository at this point in the history
Very similar to karma-runner#20
  • Loading branch information
robrich committed Sep 12, 2015
1 parent a5e951a commit 836f89f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for
var writeXmlForBrowser = function (browser) {
var outputFile = outputDir + 'TESTS-' + browser.name.replace(/ /g, '_') + '.xml'
var xmlToOutput = suites[browser.id]
if (!xmlToOutput) {
return; // don't die if browser didn't start
}

pendingFileWritings++
helper.mkdirIfNotExists(outputDir, function () {
Expand Down Expand Up @@ -72,6 +75,9 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for
this.onBrowserComplete = function (browser) {
var suite = suites[browser.id]
var result = browser.lastResult
if (!suite || !result) {
return; // don't die if browser didn't start
}

suite.att('tests', result.total)
suite.att('errors', result.disconnected || result.error ? 1 : 0)
Expand Down

2 comments on commit 836f89f

@rkaliyug
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which version of karma-junit-reporter has this fix?

@robrich
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

karma-runner#60 was merged on Sept 12, 2015 as karma-runner@e0ca1e9 and it looks like 0.3.5 went out a few weeks later. I find these changes in master right now too.

Please sign in to comment.