min.js 603 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Module dependencies.
  3. */
  4. var Base = require('./base');
  5. /**
  6. * Expose `Min`.
  7. */
  8. exports = module.exports = Min;
  9. /**
  10. * Initialize a new `Min` minimal test reporter (best used with --watch).
  11. *
  12. * @param {Runner} runner
  13. * @api public
  14. */
  15. function Min(runner) {
  16. Base.call(this, runner);
  17. runner.on('start', function(){
  18. // clear screen
  19. process.stdout.write('\u001b[2J');
  20. // set cursor position
  21. process.stdout.write('\u001b[1;3H');
  22. });
  23. runner.on('end', this.epilogue.bind(this));
  24. }
  25. /**
  26. * Inherit from `Base.prototype`.
  27. */
  28. Min.prototype.__proto__ = Base.prototype;