File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -783,23 +783,13 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
783783
784784 async function waitForHelloGoodbyeOutput ( dc : DebugClient ) : Promise < DebugProtocol . Event > {
785785 return await new Promise < DebugProtocol . Event > ( ( resolve , reject ) => {
786- const listen = ( ) => {
787- dc . waitForEvent ( 'output' , 5_000 )
788- . then ( ( event ) => {
789- // Run listen again to make sure we can get the next events.
790- listen ( ) ;
791- if ( event . body . output === 'Hello, World!\n' || event . body . output === 'Goodbye, World.\n' ) {
792- // Resolve when we have found the event that we want.
793- resolve ( event ) ;
794- return ;
795- }
796- } )
797- . catch ( ( reason ) => reject ( reason ) ) ;
798- } ;
799- // Start listening for an output event. Especially because
800- // logging is enabled in dlv-dap, there are many output events, and it is
801- // possible to miss them if we are not prepared to handle them.
802- listen ( ) ;
786+ dc . on ( 'output' , ( event ) => {
787+ if ( event . body . output === 'Hello, World!\n' || event . body . output === 'Goodbye, World.\n' ) {
788+ // Resolve when we have found the event that we want.
789+ resolve ( event ) ;
790+ return ;
791+ }
792+ } ) ;
803793 } ) ;
804794 }
805795
You can’t perform that action at this time.
0 commit comments