Skip to content

Commit

Permalink
fix(karma): Escape quotes for file names. This fixes issue karma-runn…
Browse files Browse the repository at this point in the history
  • Loading branch information
Moumi committed Feb 24, 2016
1 parent d3bec1e commit 0c2dffc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/middleware/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ var createKarmaMiddleware = function (filesPromise, serveStaticFile, serveFile,
var mappings = files.served.map(function (file) {
// Windows paths contain backslashes and generate bad IDs if not escaped
var filePath = filePathToUrlPath(file.path, basePath, urlRoot).replace(/\\/g, '\\\\')
// Escape any quotes that might be in the filename
filePath = filePath.replace(/'/g, '\\\'').replace(/"/g, '\\\"')

return util.format(" '%s': '%s'", filePath, file.sha)
})
Expand Down

0 comments on commit 0c2dffc

Please sign in to comment.