Skip to content

Commit b897185

Browse files
committed
fix: duplicate code more
1 parent 09ff396 commit b897185

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,12 @@ describe('AuthUtil', async function () {
456456
},
457457
}
458458

459-
const mockIamLogin = {
459+
const mockIamLoginArn = {
460460
login: sinon.stub().resolves(mockResponse),
461461
loginType: 'iam',
462462
}
463463

464-
sinon.stub(auth2, 'IamLogin').returns(mockIamLogin as any)
464+
sinon.stub(auth2, 'IamLogin').returns(mockIamLoginArn as any)
465465

466466
const response = await auth.loginIam(
467467
'accessKey',
@@ -470,9 +470,9 @@ describe('AuthUtil', async function () {
470470
'arn:aws:iam::123456789012:role/TestRole'
471471
)
472472

473-
assert.ok(mockIamLogin.login.calledOnce)
473+
assert.ok(mockIamLoginArn.login.calledOnce)
474474
assert.ok(
475-
mockIamLogin.login.calledWith({
475+
mockIamLoginArn.login.calledWith({
476476
accessKey: 'accessKey',
477477
secretKey: 'secretKey',
478478
sessionToken: 'sessionToken',

packages/core/src/test/amazonq/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ export async function createSession({
7373

7474
const client = sinon.createStubInstance(FeatureDevClient)
7575
client.createConversation.resolves(conversationID)
76-
const session = new Session(sessionConfig, messenger, tabID, sessionState, client)
76+
const sessionNew = new Session(sessionConfig, messenger, tabID, sessionState, client)
7777

78-
sinon.stub(session, 'conversationId').get(() => conversationID)
79-
sinon.stub(session, 'uploadId').get(() => uploadID)
78+
sinon.stub(sessionNew, 'conversationId').get(() => conversationID)
79+
sinon.stub(sessionNew, 'uploadId').get(() => uploadID)
8080

81-
return session
81+
return sessionNew
8282
}
8383

8484
export async function sessionRegisterProvider(session: Session, uri: vscode.Uri, fileContents: Uint8Array) {
8585
session.config.fs.registerProvider(uri, new VirtualMemoryFile(fileContents))
8686
}
8787

8888
export function generateVirtualMemoryUri(uploadID: string, filePath: string, scheme: string) {
89-
const generationFilePath = path.join(uploadID, filePath)
90-
const uriNew = vscode.Uri.from({ scheme, path: generationFilePath })
89+
const generationFilePathNew = path.join(uploadID, filePath)
90+
const uriNew = vscode.Uri.from({ scheme, path: generationFilePathNew })
9191
return uriNew
9292
}
9393

0 commit comments

Comments
 (0)