diff --git a/lib/middleware/karma.js b/lib/middleware/karma.js index 3392096bd..c26e3bc00 100644 --- a/lib/middleware/karma.js +++ b/lib/middleware/karma.js @@ -174,8 +174,7 @@ var createKarmaMiddleware = function ( var scriptTags = [] var scriptUrls = [] - for (var i in files.included) { - var file = files.included[i] + files.included.forEach(function(file) { var filePath = file.path var fileExt = path.extname(filePath) @@ -191,12 +190,12 @@ var createKarmaMiddleware = function ( if (fileExt === '.css') { scriptTags.push(util.format(LINK_TAG_CSS, filePath)) - continue + return } if (fileExt === '.html') { scriptTags.push(util.format(LINK_TAG_HTML, filePath)) - continue + return } // The script tag to be placed @@ -209,7 +208,7 @@ var createKarmaMiddleware = function ( var crossOriginAttribute = includeCrossOriginAttribute ? CROSSORIGIN_ATTRIBUTE : '' scriptTags.push(util.format(SCRIPT_TAG, scriptType, filePath, crossOriginAttribute)) - } + }) // TODO(vojta): don't compute if it's not in the template var mappings = files.served.map(function (file) {