@@ -9,22 +9,20 @@ const startCLI = require('../common/debugger');
9
9
const assert = require ( 'assert' ) ;
10
10
11
11
// Custom port.
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 ( [ `--port=${ common . PORT } ` , script ] ) ;
16
-
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
- new RegExp ( `< Debugger listening on [^\n]*${ common . PORT } ` ) ,
24
- 'forwards child output' ) ;
25
- } )
26
- . then ( ( ) => cli . quit ( ) )
27
- . then ( ( code ) => {
28
- assert . strictEqual ( code , 0 ) ;
29
- } ) ;
30
- }
14
+ const cli = startCLI ( [ `--port=${ common . PORT } ` , script ] ) ;
15
+ ( async function ( ) {
16
+ try {
17
+ await cli . waitForInitialBreak ( ) ;
18
+ await cli . waitForPrompt ( ) ;
19
+ assert . match ( cli . output , / d e b u g > / , 'prints a prompt' ) ;
20
+ assert . match (
21
+ cli . output ,
22
+ new RegExp ( `< Debugger listening on [^\n]*${ common . PORT } ` ) ,
23
+ 'forwards child output' ) ;
24
+ } finally {
25
+ const code = await cli . quit ( ) ;
26
+ assert . strictEqual ( code , 0 ) ;
27
+ }
28
+ } ) ( ) . then ( common . mustCall ( ) ) ;
0 commit comments