/*
 * Copyright 2014 Workiva, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

(function(karma, System) {

    // Prevent immediately starting tests.
    window.__karma__.loaded = function() {};

    function extractModuleName(fileName){
        return fileName.replace(/\.js$/, "");
    }

    var promises = [];

    if(!System){
        throw new Error("SystemJS was not found. Please make sure you have " +
                        "initialized jspm via installing a dependency with jspm, " +
                        "or by running 'jspm dl-loader'.");
    }

    // Configure SystemJS baseURL
    System.config({
        baseURL: 'base'
    });

    // Load everything specified in loadFiles
    karma.config.jspm.expandedFiles.map(function(modulePath){
        var promise = System.import(extractModuleName(modulePath))
            .catch(function(e){
                setTimeout(function() {
                    throw e;
                });
            });
        promises.push(promise);
    });

    // Promise comes from the es6_module_loader
    Promise.all(promises).then(function(){
        karma.start();
    });

})(window.__karma__, window.System);

@@ -1210,16 +1210,36 @@
 iles%0A   
+ for (var i = 0; i %3C
  karma.c
@@ -1267,33 +1267,83 @@
 les.
-map(function(modulePath)%7B
+length; i++) %7B%0A        var modulePath = karma.config.jspm.expandedFiles%5Bi%5D;
 %0A   
@@ -1576,26 +1576,24 @@
 mise);%0A    %7D
-);
 %0A%0A    // Pro

Replace Array.map with old-fashioned for loop