min.js 625 B

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