@@ -89,6 +89,17 @@ describe("getDefaultRoleAssumer", () => {
89
89
) ;
90
90
} ) ;
91
91
92
+ it ( "should return accountId in the credentials" , async ( ) => {
93
+ const roleAssumer = getDefaultRoleAssumer ( ) ;
94
+ const params : AssumeRoleCommandInput = {
95
+ RoleArn : "arn:aws:foo" ,
96
+ RoleSessionName : "session" ,
97
+ } ;
98
+ const sourceCred = { accessKeyId : "key" , secretAccessKey : "secrete" } ;
99
+ const assumedRole = await roleAssumer ( sourceCred , params ) ;
100
+ expect ( assumedRole . accountId ) . toEqual ( "123456789012" ) ;
101
+ } ) ;
102
+
92
103
it ( "should use the STS client config" , async ( ) => {
93
104
const logger = console ;
94
105
const region = "some-region" ;
@@ -209,6 +220,17 @@ describe("getDefaultRoleAssumerWithWebIdentity", () => {
209
220
} ) ;
210
221
} ) ;
211
222
223
+ it ( "should return accountId in the credentials" , async ( ) => {
224
+ const roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity ( ) ;
225
+ const params : AssumeRoleWithWebIdentityCommandInput = {
226
+ RoleArn : "arn:aws:foo" ,
227
+ RoleSessionName : "session" ,
228
+ WebIdentityToken : "token" ,
229
+ } ;
230
+ const assumedRole = await roleAssumerWithWebIdentity ( params ) ;
231
+ expect ( assumedRole . accountId ) . toEqual ( "123456789012" ) ;
232
+ } ) ;
233
+
212
234
it ( "should use the STS client middleware" , async ( ) => {
213
235
const customMiddlewareFunction = jest . fn ( ) ;
214
236
const roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity ( { } , [
0 commit comments