Code coverage report for lib/reporters/index.js

Statements: 100% (7 / 7)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (7 / 7)      Ignored: none     

All files » lib/reporters/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28    1                       1   4 4 3   3           1  
'use strict';
 
var reporters = {
  console: require('./console-reporter'),
  fail: require('./fail-reporter'),
  jshint: require('./jshint-reporter')
};
 
/**
 * Factory for returning new reporter object.
 *
 * @param {String} name
 * @return {Function}
 */
function reporterFactory(name)
{
  var args = Array.prototype.slice.call(arguments);
  var Reporter = reporters[name].bind.apply(reporters[name], args);
  var reporter = new Reporter();
 
  return reporter.run();
}
 
/**
 * @type {reporterFactory}
 */
module.exports = reporterFactory;