@@ -62,7 +62,7 @@ describe("fromTemporaryCredentials", () => {
62
62
secretAccessKey : "SECRET_ACCESS_KEY" ,
63
63
sessionToken : "SESSION_TOKEN" ,
64
64
} ) ;
65
- expect ( vi . mocked ( STSClient ) ) . toHaveBeenCalledWith ( {
65
+ expect ( vi . mocked ( STSClient as any ) ) . toHaveBeenCalledWith ( {
66
66
credentials : masterCredentials ,
67
67
region,
68
68
} ) ;
@@ -86,7 +86,7 @@ describe("fromTemporaryCredentials", () => {
86
86
clientPlugins : [ plugin ] ,
87
87
} ) ;
88
88
await provider ( ) ;
89
- expect ( vi . mocked ( STSClient ) ) . toHaveBeenCalledWith ( {
89
+ expect ( vi . mocked ( STSClient as any ) ) . toHaveBeenCalledWith ( {
90
90
credentials : masterCredentials ,
91
91
} ) ;
92
92
expect ( mockUsePlugin ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -101,7 +101,7 @@ describe("fromTemporaryCredentials", () => {
101
101
} ,
102
102
} ) ;
103
103
await provider ( ) ;
104
- expect ( vi . mocked ( STSClient ) ) . toHaveBeenCalledWith ( { } ) ;
104
+ expect ( vi . mocked ( STSClient as any ) ) . toHaveBeenCalledWith ( { } ) ;
105
105
} ) ;
106
106
107
107
it ( "should create a role session name if none provided" , async ( ) => {
@@ -140,22 +140,22 @@ describe("fromTemporaryCredentials", () => {
140
140
expect ( credentials . accessKeyId ) . toBe ( "access_id_from_third" ) ;
141
141
// Creates STS Client with right master credentials and assume role with
142
142
// expected role arn.
143
- expect ( vi . mocked ( STSClient ) . mock . results . length ) . toBe ( 3 ) ;
144
- const outmostClient = vi . mocked ( STSClient ) . mock . results [ 0 ] . value ;
143
+ expect ( vi . mocked ( STSClient as any ) . mock . results . length ) . toBe ( 3 ) ;
144
+ const outmostClient = vi . mocked ( STSClient as any ) . mock . results [ 0 ] . value ;
145
145
expect ( outmostClient . config . credentials ) . toEqual ( expect . objectContaining ( { accessKeyId : "access_id_from_second" } ) ) ;
146
146
expect ( ( outmostClient . send as any ) . mock . calls . length ) . toBe ( 1 ) ;
147
147
expect ( ( outmostClient . send as any ) . mock . calls [ 0 ] [ 0 ] . input ) . toEqual (
148
148
expect . objectContaining ( { RoleArn : roleArnOf ( "third" ) } )
149
149
) ;
150
150
151
- const middleClient = vi . mocked ( STSClient ) . mock . results [ 1 ] . value ;
151
+ const middleClient = vi . mocked ( STSClient as any ) . mock . results [ 1 ] . value ;
152
152
expect ( middleClient . config . credentials ) . toEqual ( expect . objectContaining ( { accessKeyId : "access_id_from_first" } ) ) ;
153
153
expect ( ( middleClient . send as any ) . mock . calls . length ) . toBe ( 1 ) ;
154
154
expect ( ( middleClient . send as any ) . mock . calls [ 0 ] [ 0 ] . input ) . toEqual (
155
155
expect . objectContaining ( { RoleArn : roleArnOf ( "second" ) } )
156
156
) ;
157
157
158
- const innermostClient = vi . mocked ( STSClient ) . mock . results [ 2 ] . value ;
158
+ const innermostClient = vi . mocked ( STSClient as any ) . mock . results [ 2 ] . value ;
159
159
expect ( innermostClient . config . credentials ) . toEqual ( undefined ) ;
160
160
expect ( ( innermostClient . send as any ) . mock . calls . length ) . toBe ( 1 ) ;
161
161
expect ( ( innermostClient . send as any ) . mock . calls [ 0 ] [ 0 ] . input ) . toEqual (
@@ -169,7 +169,7 @@ describe("fromTemporaryCredentials", () => {
169
169
170
170
// Should not create extra clients if credentials is still valid
171
171
await provider ( ) ;
172
- expect ( vi . mocked ( STSClient ) . mock . results . length ) . toBe ( 3 ) ;
172
+ expect ( vi . mocked ( STSClient as any ) . mock . results . length ) . toBe ( 3 ) ;
173
173
} ) ;
174
174
175
175
it ( "should support assuming a role with multi-factor authentication" , async ( ) => {
0 commit comments