@@ -367,13 +367,13 @@ describe('AuthUtil', async function () {
367367 auth . session = new auth2 . SsoLogin ( auth . profileName , auth . lspAuth , auth . eventEmitter )
368368 }
369369
370- const updateProfileStub = sinon . stub ( ( auth as any ) . session , 'updateProfile' ) . resolves ( )
370+ const updateProfileStubNew = sinon . stub ( ( auth as any ) . session , 'updateProfile' ) . resolves ( )
371371
372372 await auth . migrateSsoConnectionToLsp ( 'test-client' )
373373
374- assert . ok ( updateProfileStub . calledOnce )
374+ assert . ok ( updateProfileStubNew . calledOnce )
375375 assert . ok ( memento . update . calledWith ( 'auth.profiles' , undefined ) )
376- assert . deepStrictEqual ( updateProfileStub . firstCall . args [ 0 ] , {
376+ assert . deepStrictEqual ( updateProfileStubNew . firstCall . args [ 0 ] , {
377377 startUrl : validProfile . startUrl ,
378378 region : validProfile . ssoRegion ,
379379 scopes : validProfile . scopes ,
@@ -396,12 +396,12 @@ describe('AuthUtil', async function () {
396396 auth . session = new auth2 . SsoLogin ( auth . profileName , auth . lspAuth , auth . eventEmitter )
397397 }
398398
399- const updateProfileStub = sinon . stub ( ( auth as any ) . session , 'updateProfile' ) . resolves ( )
399+ const updateProfileStubNext = sinon . stub ( ( auth as any ) . session , 'updateProfile' ) . resolves ( )
400400
401401 await auth . migrateSsoConnectionToLsp ( 'test-client' )
402402
403403 assert . ok (
404- updateProfileStub . calledWith ( {
404+ updateProfileStubNext . calledWith ( {
405405 startUrl : validProfile . startUrl ,
406406 region : validProfile . ssoRegion ,
407407 scopes : validProfile . scopes ,
@@ -450,28 +450,36 @@ describe('AuthUtil', async function () {
450450 accessKeyId : 'encrypted-access-key' ,
451451 secretAccessKey : 'encrypted-secret-key' ,
452452 sessionToken : 'encrypted-session-token' ,
453+ roleArn : 'arn:aws:iam::123456789012:role/TestRole' ,
453454 } ,
454455 updateCredentialsParams : {
455456 data : 'credential-data' ,
456457 } ,
457458 }
458-
459+
459460 const mockIamLogin = {
460461 login : sinon . stub ( ) . resolves ( mockResponse ) ,
461462 loginType : 'iam' ,
462463 }
463-
464+
464465 sinon . stub ( auth2 , 'IamLogin' ) . returns ( mockIamLogin as any )
465-
466- const response = await auth . loginIam ( 'accessKey' , 'secretKey' , 'sessionToken' , 'arn:aws:iam::123456789012:role/TestRole' )
467-
466+
467+ const response = await auth . loginIam (
468+ 'accessKey' ,
469+ 'secretKey' ,
470+ 'sessionToken' ,
471+ 'arn:aws:iam::123456789012:role/TestRole'
472+ )
473+
468474 assert . ok ( mockIamLogin . login . calledOnce )
469- assert . ok ( mockIamLogin . login . calledWith ( {
470- accessKey : 'accessKey' ,
471- secretKey : 'secretKey' ,
472- sessionToken : 'sessionToken' ,
473- roleArn : 'arn:aws:iam::123456789012:role/TestRole' ,
474- } ) )
475+ assert . ok (
476+ mockIamLogin . login . calledWith ( {
477+ accessKey : 'accessKey' ,
478+ secretKey : 'secretKey' ,
479+ sessionToken : 'sessionToken' ,
480+ roleArn : 'arn:aws:iam::123456789012:role/TestRole' ,
481+ } )
482+ )
475483 assert . strictEqual ( response , mockResponse )
476484 } )
477485 } )
@@ -574,4 +582,4 @@ describe('AuthUtil', async function () {
574582 assert . strictEqual ( mockLspAuth . updateIamCredential . firstCall . args [ 0 ] . data , 'fake-data' )
575583 } )
576584 } )
577- } )
585+ } )
0 commit comments