@@ -12,7 +12,6 @@ import {
1212 codeWhispererClient ,
1313} from 'aws-core-vscode/codewhisperer'
1414import { globals , getClientId , getOperatingSystem } from 'aws-core-vscode/shared'
15- import { AWSError , Request } from 'aws-sdk'
1615import { createSpyClient } from 'aws-core-vscode/test'
1716
1817describe ( 'codewhisperer' , async function ( ) {
@@ -102,14 +101,11 @@ describe('codewhisperer', async function () {
102101 } )
103102
104103 it ( 'sendTelemetryEvent should be called with UserContext payload' , async function ( ) {
105- const clientSpyStub = sinon . stub ( clientSpy , 'sendTelemetryEvent' ) . returns ( {
106- promise : ( ) =>
107- Promise . resolve ( {
108- $response : {
109- requestId : '' ,
110- } ,
111- } ) ,
112- } as Request < SendTelemetryEventResponse , AWSError > )
104+ const clientSpyStub = sinon . stub ( clientSpy , 'sendTelemetryEvent' ) . resolves ( {
105+ $metadata : {
106+ requestId : '' ,
107+ } ,
108+ } as SendTelemetryEventResponse )
113109
114110 const expectedUserContext = {
115111 ideCategory : 'VSCODE' ,
@@ -127,14 +123,11 @@ describe('codewhisperer', async function () {
127123 isSso : boolean ,
128124 isTelemetryEnabled : boolean
129125 ) {
130- const clientSpyStub = sinon . stub ( clientSpy , 'sendTelemetryEvent' ) . returns ( {
131- promise : ( ) =>
132- Promise . resolve ( {
133- $response : {
134- requestId : '' ,
135- } ,
136- } ) ,
137- } as Request < SendTelemetryEventResponse , AWSError > )
126+ const clientSpyStub = sinon . stub ( clientSpy , 'sendTelemetryEvent' ) . resolves ( {
127+ $metadata : {
128+ requestId : '' ,
129+ } ,
130+ } as SendTelemetryEventResponse )
138131
139132 const authUtilStub = sinon . stub ( AuthUtil . instance , 'isValidEnterpriseSsoInUse' ) . returns ( isSso )
140133 await globals . telemetry . setTelemetryEnabled ( isTelemetryEnabled )
0 commit comments