src/utils.js
function mapSuites(suite, totalTestsReg, config) {
  const suites = _.compact(_.map(suite.suites, subSuite => (
    mapSuites(subSuite, totalTestsReg, config)
  )));
  const toBeCleaned = Object.assign({}, suite, { suites });
  return cleanSuite(toBeCleaned, totalTestsReg, config);
}
function mapSuites(suite, totalTestsReg, config) {
  const suites = _.compact(_.map(suite.suites, subSuite => (
    mapSuites(subSuite, totalTestsReg, config)
  )));
  const toBeCleaned = Object.assign({}, suite, { suites });
  return cleanSuite(toBeCleaned, totalTestsReg, config);
}
function mapSuites ( suite , totalTestsReg , config ) { const suites = _ . compact ( _ . map ( suite . suites , subSuite => ( mapSuites ( subSuite , totalTestsReg , config ) ) ) ) ; const toBeCleaned = Object . assign ( { } , suite , { suites } ) ; return cleanSuite ( toBeCleaned , totalTestsReg , config ) ; }
Map over a suite, returning a cleaned suite object
and recursively cleaning any nested suites.

@param {Object} suite          Suite to map over
@param {Object} totalTestsReg  Cumulative count of total tests registered
@param {Integer} totalTestsReg.total
@param {Object} config         Reporter configuration
Map over a suite returning a cleaned suite object and recursively cleaning any nested suites .