@@ -9,22 +9,21 @@ const startCLI = require('../common/debugger');
9
9
const assert = require ( 'assert' ) ;
10
10
11
11
// Random port with --inspect-port=0.
12
- {
13
- const script = fixtures . path ( 'debugger' , 'three-lines.js' ) ;
12
+ const script = fixtures . path ( 'debugger' , 'three-lines.js' ) ;
14
13
15
- const cli = startCLI ( [ '--inspect-port=0' , script ] ) ;
14
+ const cli = startCLI ( [ '--inspect-port=0' , script ] ) ;
16
15
17
- cli . waitForInitialBreak ( )
18
- . then ( ( ) => cli . waitForPrompt ( ) )
19
- . then ( ( ) => {
20
- assert . match ( cli . output , / d e b u g > / , 'prints a prompt' ) ;
21
- assert . match (
22
- cli . output ,
23
- / < D e b u g g e r l i s t e n i n g o n / ,
24
- 'forwards child output' ) ;
25
- } )
26
- . then ( ( ) => cli . quit ( ) )
27
- . then ( ( code ) => {
28
- assert . strictEqual ( code , 0 ) ;
29
- } ) ;
30
- }
16
+ ( async ( ) => {
17
+ try {
18
+ await cli . waitForInitialBreak ( )
19
+ await cli . waitForPrompt ( )
20
+ assert . match ( cli . output , / d e b u g > / , 'prints a prompt' ) ;
21
+ assert . match (
22
+ cli . output ,
23
+ / < D e b u g g e r l i s t e n i n g o n / ,
24
+ 'forwards child output' ) ;
25
+ } finally {
26
+ const code = cli . quit ( )
27
+ assert . strictEqual ( code , 0 ) ;
28
+ }
29
+ } ) ( ) ;
0 commit comments