@@ -13,15 +13,11 @@ const assert = require('assert');
1313 const script = fixtures . path ( 'debugger' , 'three-lines.js' ) ;
1414 const cli = startCLI ( [ script ] ) ;
1515
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' ) ;
2521 assert . match (
2622 cli . output ,
2723 / ^ \* \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');
3026 cli . output ,
3127 / \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
3228 'omits node-internal scripts' ) ;
33- } )
34- . then ( ( ) => cli . command ( 'scripts(true)' ) )
35- . then ( ( ) => {
29+ await cli . command ( 'scripts(true)' ) ;
3630 assert . match (
3731 cli . output ,
3832 / \* \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');
4135 cli . output ,
4236 / \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
4337 'includes node-internal scripts' ) ;
44- } )
45- . then ( ( ) => cli . quit ( ) )
46- . then ( null , onFatal ) ;
38+ } finally {
39+ await cli . quit ( ) ;
40+ }
41+ } ) ( ) . then ( common . mustCall ( ) ) ;
4742}
0 commit comments