Quit.js 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _jestWatcher() {
  7. const data = require('jest-watcher');
  8. _jestWatcher = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _defineProperty(obj, key, value) {
  14. if (key in obj) {
  15. Object.defineProperty(obj, key, {
  16. value: value,
  17. enumerable: true,
  18. configurable: true,
  19. writable: true
  20. });
  21. } else {
  22. obj[key] = value;
  23. }
  24. return obj;
  25. }
  26. class QuitPlugin extends _jestWatcher().BaseWatchPlugin {
  27. constructor(options) {
  28. super(options);
  29. _defineProperty(this, 'isInternal', void 0);
  30. this.isInternal = true;
  31. }
  32. async run() {
  33. if (typeof this._stdin.setRawMode === 'function') {
  34. this._stdin.setRawMode(false);
  35. }
  36. this._stdout.write('\n');
  37. process.exit(0);
  38. }
  39. getUsageInfo() {
  40. return {
  41. key: 'q',
  42. prompt: 'quit watch mode'
  43. };
  44. }
  45. }
  46. var _default = QuitPlugin;
  47. exports.default = _default;