min.js 642 B

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