Skip to content

Commit

Permalink
fix: initialize var suites early
Browse files Browse the repository at this point in the history
As #61 (comment)
Minor cleanup. Doing it this way should be faster though (no constructor call overhead, less code to begin with).
  • Loading branch information
randakar authored and dignifiedquire committed Dec 5, 2016
1 parent 9a22b98 commit e09acb2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for
var classNameFormatter = reporterConfig.classNameFormatter
var properties = reporterConfig.properties

var suites
var suites = []
var pendingFileWritings = 0
var fileWritingFinished = function () {}
var allMessages = []
Expand Down Expand Up @@ -107,8 +107,6 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for

// "run_start" - a test run is beginning for all browsers
this.onRunStart = function (browsers) {
suites = Object.create(null)

// TODO(vojta): remove once we don't care about Karma 0.10
browsers.forEach(initializeXmlForBrowser)
}
Expand Down

0 comments on commit e09acb2

Please sign in to comment.