@@ -8,7 +8,7 @@ import { LspTestOutlineInfo, LspTestOutlineVisitor } from "../../../shared/utils
88import * as testUtils from "../../../shared/utils/test" ;
99import { DartDebugClient } from "../../dart_debug_client" ;
1010import { createDebugClient , waitAllThrowIfTerminates } from "../../debug_helpers" ;
11- import { activate , delay , extApi , getCodeLens , getExpectedResults , getLaunchConfiguration , getPackages , getResolvedDebugConfiguration , helloWorldTestBrokenFile , helloWorldTestDupeNameFile , helloWorldTestMainFile , helloWorldTestShortFile , helloWorldTestSkipFile , helloWorldTestTreeFile , logger , makeTextTree , openFile , positionOf , setConfigForTest , waitForResult } from "../../helpers" ;
11+ import { activate , captureDebugSessionCustomEvents , delay , extApi , getCodeLens , getExpectedResults , getLaunchConfiguration , getPackages , getResolvedDebugConfiguration , helloWorldTestBrokenFile , helloWorldTestDupeNameFile , helloWorldTestMainFile , helloWorldTestShortFile , helloWorldTestSkipFile , helloWorldTestTreeFile , logger , makeTextTree , openFile , positionOf , setConfigForTest , waitForResult } from "../../helpers" ;
1212
1313describe ( "dart test debugger" , ( ) => {
1414 // We have tests that require external packages.
@@ -69,8 +69,13 @@ describe("dart test debugger", () => {
6969 assert . equal ( runAction . command ! . arguments ! [ 0 ] . fullName , "String .split() splits the string on the delimiter" ) ;
7070 assert . equal ( runAction . command ! . arguments ! [ 0 ] . isGroup , false ) ;
7171
72- const didStart = await vs . commands . executeCommand ( runAction . command ! . command , ...( runAction . command ! . arguments ?? [ ] ) ) ;
73- assert . ok ( didStart ) ;
72+ const customEvents = await captureDebugSessionCustomEvents ( async ( ) => {
73+ const didStart = await vs . commands . executeCommand ( runAction . command ! . command , ...( runAction . command ! . arguments ?? [ ] ) ) ;
74+ assert . ok ( didStart ) ;
75+ } ) ;
76+ // Ensure we got at least a "testDone" notification so we know the test run started correctly.
77+ const testDoneNotification = customEvents . find ( ( e ) => e . event === "dart.testRunNotification" && e . body . notification . type === "testDone" ) ;
78+ assert . ok ( testDoneNotification , JSON . stringify ( customEvents . map ( ( e ) => e . body ) , undefined , 4 ) ) ;
7479 } ) ;
7580
7681 it ( "receives the expected events from a Dart test script" , async ( ) => {
0 commit comments