node package manager

react-components-library

replace 'onBrowserComplete' on karma-coverage with

this.onBrowserComplete = function(browser, result) { var collector = collectors[browser.id]; var results; var replacedBasePath; var replacedKey; var keyAux; var keys; var keysIndex;

if (!collector) {
  return;
}

if (result && result.coverage) {

  if (rootConfig.jsxBuild) {
    keys = Object.keys(result.coverage);
    replacedBasePath = rootConfig.basePath;
    results = {};

    while (replacedBasePath.indexOf('/') !== -1) {
      replacedBasePath = replacedBasePath.replace('/', '\\');
    }

    for (keysIndex = 0; keysIndex < keys.length; keysIndex++) {
      keyAux = keys[keysIndex];

      if (keyAux.indexOf(replacedBasePath) === -1) {
        replacedKey = keyAux.replace('.', replacedBasePath)
        while (replacedKey.indexOf('/') !== -1) {
          replacedKey = replacedKey.replace('/', '\\');
        }

        results[replacedKey] = result.coverage[replacedKey];
        results[replacedKey].path = keyAux;
      }
    }
  } else {
    results = result.coverage;
  }

  collector.add(results);
}

};