@@ -13,15 +13,11 @@ const assert = require('assert');
13
13
const script = fixtures . path ( 'debugger' , 'three-lines.js' ) ;
14
14
const cli = startCLI ( [ script ] ) ;
15
15
16
- function onFatal ( error ) {
17
- cli . quit ( ) ;
18
- throw error ;
19
- }
20
-
21
- return cli . waitForInitialBreak ( )
22
- . then ( ( ) => cli . waitForPrompt ( ) )
23
- . then ( ( ) => cli . command ( 'scripts' ) )
24
- . then ( ( ) => {
16
+ ( async ( ) => {
17
+ try {
18
+ await cli . waitForInitialBreak ( ) ;
19
+ await cli . waitForPrompt ( ) ;
20
+ await cli . command ( 'scripts' ) ;
25
21
assert . match (
26
22
cli . output ,
27
23
/ ^ \* \d + : \S + d e b u g g e r (?: \/ | \\ ) t h r e e - l i n e s \. j s / m,
@@ -30,9 +26,7 @@ const assert = require('assert');
30
26
cli . output ,
31
27
/ \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
32
28
'omits node-internal scripts' ) ;
33
- } )
34
- . then ( ( ) => cli . command ( 'scripts(true)' ) )
35
- . then ( ( ) => {
29
+ await cli . command ( 'scripts(true)' ) ;
36
30
assert . match (
37
31
cli . output ,
38
32
/ \* \d + : \S + d e b u g g e r (?: \/ | \\ ) t h r e e - l i n e s \. j s / ,
@@ -41,7 +35,8 @@ const assert = require('assert');
41
35
cli . output ,
42
36
/ \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
43
37
'includes node-internal scripts' ) ;
44
- } )
45
- . then ( ( ) => cli . quit ( ) )
46
- . then ( null , onFatal ) ;
38
+ } finally {
39
+ await cli . quit ( ) ;
40
+ }
41
+ } ) ( ) . then ( common . mustCall ( ) ) ;
47
42
}
0 commit comments