reporter.js 342 B

1234567891011121314151617
  1. "use strict";
  2. /**
  3. * Reporter module for benchmark.js instances.
  4. * @private
  5. */
  6. module.exports = function reporter(bench){
  7. var ctx = this;
  8. return bench
  9. .on("error", function(){
  10. if (ctx.file) console.error("ERROR in file: " + ctx.file);
  11. throw bench.error;
  12. })
  13. .on("complete", function() {
  14. console.log(String(this));
  15. });
  16. };