@@ -13,39 +13,8 @@ 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(() => {
25- // assert.match(
26- // cli.output,
27- // /^\* \d+: \S+debugger(?:\/|\\)three-lines\.js/m,
28- // 'lists the user script');
29- // assert.doesNotMatch(
30- // cli.output,
31- // /\d+: node:internal\/buffer/,
32- // 'omits node-internal scripts');
33- // })
34- // .then(() => cli.command('scripts(true)'))
35- // .then(() => {
36- // assert.match(
37- // cli.output,
38- // /\* \d+: \S+debugger(?:\/|\\)three-lines\.js/,
39- // 'lists the user script');
40- // assert.match(
41- // cli.output,
42- // /\d+: node:internal\/buffer/,
43- // 'includes node-internal scripts');
44- // })
45- // .then(() => cli.quit())
46- // .then(null, onFatal);
47-
4816 ( async ( ) => {
17+ try {
4918 await cli . waitForInitialBreak ( ) ;
5019 await cli . waitForPrompt ( ) ;
5120 await cli . command ( 'scripts' ) ;
@@ -66,8 +35,8 @@ const assert = require('assert');
6635 cli . output ,
6736 / \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
6837 'includes node-internal scripts' ) ;
69- } ) ( )
70- . then ( ( ) => cli . quit ( ) )
71- . then ( null , onFatal ) ;
72-
38+ } finally {
39+ await cli . quit ( ) ;
40+ }
41+ } ) ( ) . then ( common . mustCall ) ;
7342}
0 commit comments