@@ -5,18 +5,14 @@ const { test } = require('tap');
55
66const startCLI = require ( './start-cli' ) ;
77
8- test ( 'examples/empty .js' , ( t ) => {
9- const script = Path . join ( 'examples' , 'empty .js' ) ;
8+ test ( 'examples/three-lines .js' , ( t ) => {
9+ const script = Path . join ( 'examples' , 'three-lines .js' ) ;
1010 const cli = startCLI ( [ script ] ) ;
1111
12- return cli . waitFor ( / b r e a k / )
12+ return cli . waitForInitialBreak ( )
1313 . then ( ( ) => cli . waitForPrompt ( ) )
1414 . then ( ( ) => {
1515 t . match ( cli . output , 'debug>' , 'prints a prompt' ) ;
16- t . match (
17- cli . output ,
18- '< Debugger listening on port 9229' ,
19- 'forwards child output' ) ;
2016 } )
2117 . then ( ( ) => cli . command ( '["hello", "world"].join(" ")' ) )
2218 . then ( ( ) => {
@@ -45,7 +41,7 @@ test('run after quit / restart', (t) => {
4541 throw error ;
4642 }
4743
48- return cli . waitFor ( / b r e a k / )
44+ return cli . waitForInitialBreak ( )
4945 . then ( ( ) => cli . waitForPrompt ( ) )
5046 . then ( ( ) => cli . stepCommand ( 'n' ) )
5147 . then ( ( ) => {
@@ -72,6 +68,7 @@ test('run after quit / restart', (t) => {
7268 t . match ( cli . output , 'Use `run` to start the app again' ) ;
7369 } )
7470 . then ( ( ) => cli . stepCommand ( 'run' ) )
71+ . then ( ( ) => cli . waitForInitialBreak ( ) )
7572 . then ( ( ) => cli . waitForPrompt ( ) )
7673 . then ( ( ) => {
7774 t . match (
@@ -87,6 +84,7 @@ test('run after quit / restart', (t) => {
8784 'steps to the 2nd line' ) ;
8885 } )
8986 . then ( ( ) => cli . stepCommand ( 'restart' ) )
87+ . then ( ( ) => cli . waitForInitialBreak ( ) )
9088 . then ( ( ) => {
9189 t . match (
9290 cli . output ,
@@ -100,6 +98,7 @@ test('run after quit / restart', (t) => {
10098 t . match ( cli . output , 'Use `run` to start the app again' ) ;
10199 } )
102100 . then ( ( ) => cli . stepCommand ( 'run' ) )
101+ . then ( ( ) => cli . waitForInitialBreak ( ) )
103102 . then ( ( ) => cli . waitForPrompt ( ) )
104103 . then ( ( ) => {
105104 t . match (
0 commit comments