diff --git a/lib/middleware/karma.js b/lib/middleware/karma.js index a36a53617..f1b632a31 100644 --- a/lib/middleware/karma.js +++ b/lib/middleware/karma.js @@ -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) })