@@ -7,21 +7,24 @@ import { struct } from "./schemas/StructureSchema";
7
7
import { TypeRegistry } from "./TypeRegistry" ;
8
8
9
9
describe ( TypeRegistry . name , ( ) => {
10
- const [ List , Map , Struct ] = [ list ( "ack" , "List" , { sparse : 1 } , 0 ) , map ( "ack" , "Map" , 0 , 0 , 1 ) , ( ) => schema ] ;
11
- const schema = struct ( "ack" , "Structure" , { } , [ "list" , "map" , "struct" ] , [ List , Map , Struct ] ) ;
12
-
13
- const tr = TypeRegistry . for ( "ack" ) ;
10
+ const [ List , Map , Struct ] = [
11
+ list ( "NAMESPACE" , "List" , { sparse : 1 } , 0 ) ,
12
+ map ( "NAMESPACE" , "Map" , 0 , 0 , 1 ) ,
13
+ ( ) => schema ,
14
+ ] ;
15
+ const schema = struct ( "NAMESPACE" , "Structure" , { } , [ "list" , "map" , "struct" ] , [ List , Map , Struct ] ) ;
14
16
15
17
it ( "stores and retrieves schema objects" , ( ) => {
18
+ const tr = TypeRegistry . for ( "NAMESPACE" ) ;
16
19
expect ( tr . getSchema ( "List" ) ) . toBe ( List ) ;
17
20
expect ( tr . getSchema ( "Map" ) ) . toBe ( Map ) ;
18
21
expect ( tr . getSchema ( "Structure" ) ) . toBe ( schema ) ;
19
22
} ) ;
20
23
21
24
it ( "has a helper method to retrieve a synthetic base exception" , ( ) => {
22
25
// the service namespace is appended to the synthetic prefix.
23
- const err = error ( "smithyts.client. synthetic.ack " , "UhOhServiceException" , 0 , [ ] , [ ] , Error ) ;
24
- const tr = TypeRegistry . for ( "smithyts.client. synthetic.ack " ) ;
25
- expect ( tr . getBaseException ( ) ) . toEqual ( err ) ;
26
+ const err = error ( "smithy.ts.sdk. synthetic.NAMESPACE " , "UhOhServiceException" , 0 , [ ] , [ ] , Error ) ;
27
+ const tr = TypeRegistry . for ( "smithy.ts.sdk. synthetic.NAMESPACE " ) ;
28
+ expect ( tr . getBaseException ( ) ) . toBe ( err ) ;
26
29
} ) ;
27
30
} ) ;
0 commit comments