UNPKG

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