@@ -44,17 +44,21 @@ describe('Amazon Q Inline', async function () {
4444 afterEach ( async function ( ) {
4545 await closeAllEditors ( )
4646 if ( this . currentTest ?. state === undefined || this . currentTest ?. isFailed ( ) || this . currentTest ?. isPending ( ) ) {
47- const events = getEvents ( 'codewhisperer_userTriggerDecision' )
48- console . table ( {
49- 'telemetry events' : JSON . stringify ( events ) ,
50- 'suggestions states' : JSON . stringify ( session . suggestionStates ) ,
51- 'valid recommendation' : RecommendationHandler . instance . isValidResponse ( ) ,
52- 'recommendation service status' : RecommendationService . instance . isRunning ,
53- recommendations : session . recommendations ,
54- } )
47+ log ( )
5548 }
5649 } )
5750
51+ function log ( ) {
52+ const events = getEvents ( 'codewhisperer_userTriggerDecision' )
53+ console . table ( {
54+ 'telemetry events' : JSON . stringify ( events ) ,
55+ 'suggestions states' : JSON . stringify ( session . suggestionStates ) ,
56+ 'valid recommendation' : RecommendationHandler . instance . isValidResponse ( ) ,
57+ 'recommendation service status' : RecommendationService . instance . isRunning ,
58+ recommendations : session . recommendations ,
59+ } )
60+ }
61+
5862 async function setupEditor ( { name, contents } : { name ?: string; contents ?: string } = { } ) {
5963 const fileName = name ?? 'test.ts'
6064 const textContents =
@@ -79,6 +83,9 @@ describe('Amazon Q Inline', async function () {
7983 `Suggestions failed to become visible. Suggestion States: ${ JSON . stringify ( session . suggestionStates ) } `
8084 )
8185 }
86+ if ( session . recommendations . length === 0 ) {
87+ throw new Error ( 'No recommendations were generated' )
88+ }
8289 }
8390
8491 /**
@@ -162,9 +169,13 @@ describe('Amazon Q Inline', async function () {
162169 while ( attempt < retries ) {
163170 try {
164171 await setup ( )
172+ console . log ( 'succeeded' )
173+ log ( )
165174 break
166175 } catch ( e ) {
167- console . error ( e )
176+ console . log ( 'failed' )
177+ console . log ( e )
178+ log ( )
168179 attempt ++
169180 }
170181 }
0 commit comments