|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | | -(() => { |
4 | | - const CLIArgumentParser = require('testcafe/lib/cli/argument-parser'); |
5 | | - const exitHook = require('async-exit-hook'); |
6 | | - const keypress = require('keypress'); |
7 | | - const controller = require('./controller'); |
| 3 | +const CLIArgumentParser = require('testcafe/lib/cli/argument-parser'); |
| 4 | +const exitHook = require('async-exit-hook'); |
| 5 | +const keypress = require('keypress'); |
| 6 | +const controller = require('./controller'); |
8 | 7 |
|
9 | | - const tcArguments = new CLIArgumentParser(); |
| 8 | +const tcArguments = new CLIArgumentParser(); |
10 | 9 |
|
11 | | - exitHook(cb => { |
12 | | - controller.exit() |
13 | | - .then(cb); |
14 | | - }); |
| 10 | +exitHook(cb => { |
| 11 | + controller.exit() |
| 12 | + .then(cb); |
| 13 | +}); |
15 | 14 |
|
16 | | - tcArguments.parse(process.argv) |
17 | | - .then(() => controller.init(tcArguments)); |
| 15 | +tcArguments.parse(process.argv) |
| 16 | + .then(() => controller.init(tcArguments)); |
18 | 17 |
|
19 | 18 |
|
20 | | - // Listen commands |
21 | | - keypress(process.stdin); |
| 19 | +// Listen commands |
| 20 | +keypress(process.stdin); |
22 | 21 |
|
23 | | - process.stdin.on('keypress', function (ch, key) { |
24 | | - if (key && key.ctrl) { |
25 | | - if (key.name === 's') |
26 | | - controller.stop(); |
| 22 | +process.stdin.on('keypress', function (ch, key) { |
| 23 | + if (key && key.ctrl) { |
| 24 | + if (key.name === 's') |
| 25 | + controller.stop(); |
27 | 26 |
|
28 | | - else if (key.name === 'r') |
29 | | - controller.restart(); |
| 27 | + else if (key.name === 'r') |
| 28 | + controller.restart(); |
30 | 29 |
|
31 | | - else if (key.name === 'c') |
32 | | - controller.exit().then(() => process.exit(0)); |
| 30 | + else if (key.name === 'c') |
| 31 | + controller.exit().then(() => process.exit(0)); |
33 | 32 |
|
34 | | - else if (key.name === 'w') |
35 | | - controller.toggleWatching(); |
| 33 | + else if (key.name === 'w') |
| 34 | + controller.toggleWatching(); |
36 | 35 |
|
37 | | - } |
38 | | - }); |
| 36 | + } |
| 37 | +}); |
39 | 38 |
|
40 | | - process.stdin.setRawMode(true); |
41 | | -})(); |
| 39 | +process.stdin.setRawMode(true); |
0 commit comments