Skip to content

Commit

Permalink
fix: escape filesystem characters in browser name
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sutton committed Oct 22, 2015
1 parent a95a93f commit 2ade70f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var os = require('os')
var path = require('path')
var fs = require('fs')
var builder = require('xmlbuilder')
var sanitizeFilename = require('sanitize-filename')

var JUnitReporter = function (baseReporterDecorator, config, logger, helper, formatError) {
var log = logger.create('reporter.junit')
Expand Down Expand Up @@ -48,7 +49,7 @@ var JUnitReporter = function (baseReporterDecorator, config, logger, helper, for
}

var writeXmlForBrowser = function (browser) {
var safeBrowserName = browser.name.replace(/ /g, '_')
var safeBrowserName = sanitizeFilename(browser.name, { replacement: '_' }).replace(/ /g, '_')
var newOutputFile
if (outputFile != null) {
var dir = useBrowserName ? path.join(outputDir, safeBrowserName)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
"author": "Vojta Jina <[email protected]>",
"dependencies": {
"sanitize-filename": "1.4.5",
"xmlbuilder": "3.1.0"
},
"peerDependencies": {
Expand Down

0 comments on commit 2ade70f

Please sign in to comment.