Skip to content

Commit 95c4840

Browse files
committed
Add authUtil instantiation to test files
1 parent 08796d7 commit 95c4840

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/amazonq/test/unit/codewhisperer/service/recommendationHandler.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
stub,
2323
createMockTextEditor,
2424
resetCodeWhispererGlobalVariables,
25+
createTestAuthUtil,
2526
} from 'aws-core-vscode/test'
2627
// import * as supplementalContextUtil from 'aws-core-vscode/codewhisperer'
2728

@@ -41,6 +42,8 @@ describe('recommendationHandler', function () {
4142
const mockEditor = createMockTextEditor()
4243
const testStartUrl = 'testStartUrl'
4344

45+
await createTestAuthUtil()
46+
4447
beforeEach(async function () {
4548
sinon.restore()
4649
await resetCodeWhispererGlobalVariables()

packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import assert from 'assert'
77
import * as sinon from 'sinon'
8-
import { assertTelemetryCurried } from 'aws-core-vscode/test'
8+
import { assertTelemetryCurried, createTestAuthUtil } from 'aws-core-vscode/test'
99
import { AuthUtil, CodeWhispererTracker } from 'aws-core-vscode/codewhisperer'
1010
import { resetCodeWhispererGlobalVariables, createAcceptedSuggestionEntry } from 'aws-core-vscode/test'
1111
import { globals } from 'aws-core-vscode/shared'
@@ -82,6 +82,7 @@ describe('codewhispererTracker', function () {
8282

8383
describe('emitTelemetryOnSuggestion', function () {
8484
it('Should call recordCodewhispererUserModification with suggestion event', async function () {
85+
await createTestAuthUtil()
8586
const testStartUrl = 'testStartUrl'
8687
sinon.stub(AuthUtil.instance.connection!, 'startUrl').value(testStartUrl)
8788
const suggestion = createAcceptedSuggestionEntry()

0 commit comments

Comments
 (0)