File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
amazonq/test/unit/codewhisperer/commands Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,20 @@ import {
1313 CodeWhispererTracker ,
1414 RecommendationHandler ,
1515 AuthUtil ,
16+ CodeWhispererSession ,
1617} from 'aws-core-vscode/codewhisperer'
1718import { resetCodeWhispererGlobalVariables , createMockTextEditor } from 'aws-core-vscode/test'
1819import { assertTelemetryCurried } from 'aws-core-vscode/test'
1920
2021describe ( 'onAcceptance' , function ( ) {
22+ let session : CodeWhispererSession
2123 describe ( 'onAcceptance' , function ( ) {
2224 beforeEach ( async function ( ) {
23- const session = CodeWhispererSessionState . instance . getSession ( )
25+ session = CodeWhispererSessionState . instance . getSession ( )
2426 await resetCodeWhispererGlobalVariables ( )
25- session . reset ( )
2627 } )
2728
2829 afterEach ( function ( ) {
29- const session = CodeWhispererSessionState . instance . getSession ( )
3030 sinon . restore ( )
3131 session . reset ( )
3232 } )
@@ -72,7 +72,6 @@ describe('onAcceptance', function () {
7272 } )
7373
7474 it ( 'Should report telemetry that records this user decision event' , async function ( ) {
75- const session = CodeWhispererSessionState . instance . getSession ( )
7675 const testStartUrl = 'testStartUrl'
7776 sinon . stub ( AuthUtil . instance , 'startUrl' ) . value ( testStartUrl )
7877 const mockEditor = createMockTextEditor ( )
Original file line number Diff line number Diff line change @@ -13,20 +13,20 @@ import {
1313 RecommendationHandler ,
1414 AuthUtil ,
1515 CodeWhispererSessionState ,
16+ CodeWhispererSession ,
1617} from 'aws-core-vscode/codewhisperer'
1718import { globals } from 'aws-core-vscode/shared'
1819import { extensionVersion } from 'aws-core-vscode/shared'
1920
2021describe ( 'onInlineAcceptance' , function ( ) {
22+ let session : CodeWhispererSession
2123 describe ( 'onInlineAcceptance' , function ( ) {
2224 beforeEach ( async function ( ) {
23- const session = CodeWhispererSessionState . instance . getSession ( )
25+ session = CodeWhispererSessionState . instance . getSession ( )
2426 await resetCodeWhispererGlobalVariables ( )
25- session . reset ( )
2627 } )
2728
2829 afterEach ( function ( ) {
29- const session = CodeWhispererSessionState . instance . getSession ( )
3030 sinon . restore ( )
3131 session . reset ( )
3232 } )
@@ -51,7 +51,6 @@ describe('onInlineAcceptance', function () {
5151 } )
5252
5353 it ( 'Should report telemetry that records this user decision event' , async function ( ) {
54- const session = CodeWhispererSessionState . instance . getSession ( )
5554 await globals . globalState . update ( 'CODEWHISPERER_USER_GROUP' , {
5655 version : extensionVersion ,
5756 } )
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export { onAcceptance } from './commands/onAcceptance'
5959export { CodeWhispererTracker } from './tracker/codewhispererTracker'
6060export { RecommendationHandler } from './service/recommendationHandler'
6161export { CodeWhispererUserGroupSettings } from './util/userGroupUtil'
62- export { CodeWhispererSessionState } from './util/codeWhispererSession'
62+ export { CodeWhispererSessionState , CodeWhispererSession } from './util/codeWhispererSession'
6363export { onInlineAcceptance } from './commands/onInlineAcceptance'
6464export { stopTransformByQ } from './commands/startTransformByQ'
6565export { getCompletionItems , getCompletionItem , getLabel } from './service/completionProvider'
You can’t perform that action at this time.
0 commit comments