@@ -13,39 +13,8 @@ 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(() => {
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
-
48
16
( async ( ) => {
17
+ try {
49
18
await cli . waitForInitialBreak ( ) ;
50
19
await cli . waitForPrompt ( ) ;
51
20
await cli . command ( 'scripts' ) ;
@@ -66,8 +35,8 @@ const assert = require('assert');
66
35
cli . output ,
67
36
/ \d + : n o d e : i n t e r n a l \/ b u f f e r / ,
68
37
'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 ) ;
73
42
}
0 commit comments