File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed 
private/aws-client-api-test/src/client-interface-tests/config Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import  {  describe ,  test  as  it ,  expect  }  from  "vitest" ; 
2+ import  {  S3  }  from  "@aws-sdk/client-s3" ; 
3+ import  {  S3Control  }  from  "@aws-sdk/client-s3-control" ; 
4+ import  {  DynamoDB  }  from  "@aws-sdk/client-dynamodb" ; 
5+ import  {  EC2  }  from  "@aws-sdk/client-ec2" ; 
6+ import  {  SQS  }  from  "@aws-sdk/client-sqs" ; 
7+ import  {  Glacier  }  from  "@aws-sdk/client-glacier" ; 
8+ import  {  STS  }  from  "@aws-sdk/client-sts" ; 
9+ import  {  TranscribeStreaming  }  from  "@aws-sdk/client-transcribe-streaming" ; 
10+ import  {  Route53  }  from  "@aws-sdk/client-route-53" ; 
11+ import  {  RDS  }  from  "@aws-sdk/client-rds" ; 
12+ 
13+ describe ( "client config object custody" ,  ( )  =>  { 
14+   it ( "should maintain a consistent object reference throughout the client resolver stack lifecycle (the constructor)" ,  ( )  =>  { 
15+     const  clients  =  [ 
16+       new  S3 ( ) , 
17+       new  S3Control ( ) , 
18+       new  DynamoDB ( ) , 
19+       new  EC2 ( ) , 
20+       new  Glacier ( ) , 
21+       new  RDS ( ) , 
22+       new  Route53 ( ) , 
23+       new  SQS ( ) , 
24+       new  STS ( ) , 
25+       new  TranscribeStreaming ( ) , 
26+     ] ; 
27+     for  ( const  client  of  clients )  { 
28+       try  { 
29+         expect ( Object . keys ( client . config ) ) . toEqual ( Object . keys ( client . initConfig  ??  { } ) ) ; 
30+       }  catch  ( e )  { 
31+         throw  new  Error ( `MismatchedObjectKeys - config object custody error for ${ client . constructor . name }  ` ,  { 
32+           cause : e , 
33+         } ) ; 
34+       } 
35+ 
36+       // reference equality assertion 
37+       try  { 
38+         expect ( client . config ) . toBe ( client . initConfig ) ; 
39+       }  catch  ( e )  { 
40+         throw  new  Error ( `ReferenceEqualityError - config object custody error for ${ client . constructor . name }  ` ) ; 
41+       } 
42+     } 
43+   } ) ; 
44+ } ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments