Skip to content

Commit cf7adae

Browse files
committed
telemetryHelper.test
1 parent 331deea commit cf7adae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/amazonq/test/unit/codewhisperer/util/telemetryHelper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function aCompletion(): Completion {
3939
}
4040

4141
describe('telemetryHelper', function () {
42+
const session = CodeWhispererSessionState.instance.getSession()
4243
describe('clientComponentLatency', function () {
4344
let sut: TelemetryHelper
4445

@@ -48,10 +49,10 @@ describe('telemetryHelper', function () {
4849

4950
afterEach(function () {
5051
sinon.restore()
52+
session.reset()
5153
})
5254

5355
it('resetClientComponentLatencyTime should reset state variables', function () {
54-
const session = CodeWhispererSessionState.instance.getSession()
5556
session.invokeSuggestionStartTime = 100
5657
session.preprocessEndTime = 200
5758
session.sdkApiCallStartTime = 300
@@ -290,7 +291,6 @@ describe('telemetryHelper', function () {
290291
})
291292

292293
it('Should call telemetry record for each recommendations with proper arguments', async function () {
293-
const session = CodeWhispererSessionState.instance.getSession()
294294
const telemetryHelper = new TelemetryHelper()
295295
const response = [{ content: "print('Hello')" }]
296296
const requestIdList = ['test_x', 'test_x', 'test_y']

0 commit comments

Comments
 (0)