lib/karma-parallelizer.js
function initKarmaParallelizer(root, karma, shardIndexInfoMap) {
  var idParamExtractor = /(\?|&)id=(\d+)(&|$)/;
  var matches = idParamExtractor.exec(parent.location.search);
  var id = (matches && matches[2]) || null;

  if (
    !id ||
    !shardIndexInfoMap.hasOwnProperty(id) ||
    !shardIndexInfoMap[id].shouldShard
  ) {
    /* eslint-disable-next-line no-console */
    console.warn(
      'Skipping sharding. Could not find karma-parallel initialization data.'
    );
    return;
  }

  var shardIndexInfo = shardIndexInfoMap[id];
  var strategy = overrideSuiteStategy(getSpecSuiteStrategy(shardIndexInfo));
  var fakeContextStatus = createFakeTestContext(root, strategy);

  var origStart = karma.start;
  karma.start = function() {
    fakeContextStatus.beforeStartup();
    origStart.call(this);
  };
}
function initKarmaParallelizer(root, karma, shardIndexInfoMap) {
  var idParamExtractor = /(\?|&)id=(\d+)(&|$)/;
  var matches = idParamExtractor.exec(parent.location.search);
  var id = (matches && matches[2]) || null;

  if (
    !id ||
    !shardIndexInfoMap.hasOwnProperty(id) ||
    !shardIndexInfoMap[id].shouldShard
  ) {
    /* eslint-disable-next-line no-console */
    console.warn(
      'Skipping sharding. Could not find karma-parallel initialization data.'
    );
    return;
  }

  var shardIndexInfo = shardIndexInfoMap[id];
  var strategy = overrideSuiteStategy(getSpecSuiteStrategy(shardIndexInfo));
  var fakeContextStatus = createFakeTestContext(root, strategy);

  var origStart = karma.start;
  karma.start = function() {
    fakeContextStatus.beforeStartup();
    origStart.call(this);
  };
}
function initKarmaParallelizer ( root , karma , shardIndexInfoMap ) { var idParamExtractor = / (\?|&)id=(\d+)(&|$) / ; var matches = idParamExtractor . exec ( parent . location . search ) ; var id = ( matches && matches [ 2 ] ) || null ; if ( ! id || ! shardIndexInfoMap . hasOwnProperty ( id ) || ! shardIndexInfoMap [ id ] . shouldShard ) { /* eslint-disable-next-line no-console */ console . warn ( 'Skipping sharding. Could not find karma-parallel initialization data.' ) ; return ; } var shardIndexInfo = shardIndexInfoMap [ id ] ; var strategy = overrideSuiteStategy ( getSpecSuiteStrategy ( shardIndexInfo ) ) ; var fakeContextStatus = createFakeTestContext ( root , strategy ) ; var origStart = karma . start ; karma . start = function ( ) { fakeContextStatus . beforeStartup ( ) ; origStart . call ( this ) ; } ; }
This file gets loaded into the executing browsers and overrides the `describe` functions
This file gets loaded into the executing browsers and overrides the describe functions