@@ -29,7 +29,6 @@ import {
2929import { InlineGeneratingMessage } from '../../../../../src/app/inline/inlineGeneratingMessage'
3030import { LineTracker } from '../../../../../src/app/inline/stateTracker/lineTracker'
3131import { InlineTutorialAnnotation } from '../../../../../src/app/inline/tutorials/inlineTutorialAnnotation'
32- import { waitUntil } from 'aws-core-vscode/shared'
3332
3433describe ( 'InlineCompletionManager' , ( ) => {
3534 let manager : InlineCompletionManager
@@ -420,20 +419,19 @@ describe('InlineCompletionManager', () => {
420419 true
421420 )
422421 getActiveRecommendationStub . returns ( [ ] )
423- let messageShown = false
424- getTestWindow ( ) . onDidShowMessage ( ( e ) => {
425- assert . strictEqual ( e . message , noInlineSuggestionsMsg )
426- messageShown = true
427- } )
422+ const messageShown = new Promise ( ( resolve ) =>
423+ getTestWindow ( ) . onDidShowMessage ( ( e ) => {
424+ assert . strictEqual ( e . message , noInlineSuggestionsMsg )
425+ resolve ( true )
426+ } )
427+ )
428428 await provider . provideInlineCompletionItems (
429429 mockDocument ,
430430 mockPosition ,
431431 { triggerKind : InlineCompletionTriggerKind . Invoke , selectedCompletionInfo : undefined } ,
432432 mockToken
433433 )
434- // Wait up to a second for message to appear since there is potential race condition.
435- await waitUntil ( async ( ) => messageShown , { timeout : 1000 , interval : 100 } )
436- assert . ok ( messageShown )
434+ await messageShown
437435 } )
438436 describe ( 'debounce behavior' , function ( ) {
439437 let clock : ReturnType < typeof installFakeClock >
0 commit comments