1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function _chalk() {
|
9 | const data = _interopRequireDefault(require('chalk'));
|
10 |
|
11 | _chalk = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function _jestWatcher() {
|
19 | const data = require('jest-watcher');
|
20 |
|
21 | _jestWatcher = function () {
|
22 | return data;
|
23 | };
|
24 |
|
25 | return data;
|
26 | }
|
27 |
|
28 | function _interopRequireDefault(obj) {
|
29 | return obj && obj.__esModule ? obj : {default: obj};
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | var _default = (pipe, stdin = process.stdin) =>
|
39 | new Promise((resolve, reject) => {
|
40 | if (typeof stdin.setRawMode === 'function') {
|
41 | const messages = [
|
42 | _chalk().default.red('There are deprecation warnings.\n'),
|
43 | _chalk().default.dim(' \u203A Press ') +
|
44 | 'Enter' +
|
45 | _chalk().default.dim(' to continue.'),
|
46 | _chalk().default.dim(' \u203A Press ') +
|
47 | 'Esc' +
|
48 | _chalk().default.dim(' to exit.')
|
49 | ];
|
50 | pipe.write(messages.join('\n'));
|
51 | stdin.setRawMode(true);
|
52 | stdin.resume();
|
53 | stdin.setEncoding('utf8');
|
54 |
|
55 | stdin.on('data', key => {
|
56 | if (key === _jestWatcher().KEYS.ENTER) {
|
57 | resolve();
|
58 | } else if (
|
59 | [
|
60 | _jestWatcher().KEYS.ESCAPE,
|
61 | _jestWatcher().KEYS.CONTROL_C,
|
62 | _jestWatcher().KEYS.CONTROL_D
|
63 | ].indexOf(key) !== -1
|
64 | ) {
|
65 | reject();
|
66 | }
|
67 | });
|
68 | } else {
|
69 | resolve();
|
70 | }
|
71 | });
|
72 |
|
73 | exports.default = _default;
|