@@ -7,7 +7,10 @@ describe("TypeSchema R4 generation", async () => {
77 const r4 = await mkR4Register ( ) ;
88
99 it ( "Bundle and elementReference" , async ( ) => {
10- const profile = r4 . resolveFs ( r4Package , "http://hl7.org/fhir/StructureDefinition/Bundle" as CanonicalUrl ) ! ;
10+ const profile = r4 . resolveFs ( r4Package , "http://hl7.org/fhir/StructureDefinition/Bundle" as CanonicalUrl ) ;
11+ if ( ! profile ) {
12+ throw new Error ( "Bundle profile not found" ) ;
13+ }
1114 const ts = ( await registerFsAndMkTs ( r4 , profile ) ) [ 0 ] as RegularTypeSchema ;
1215 expect ( ts ?. nested ) . toHaveLength ( 5 ) ;
1316 expect ( ts ) . toMatchObject ( {
@@ -47,7 +50,10 @@ describe("TypeSchema R4 generation", async () => {
4750 } ) ;
4851
4952 it ( "markdown" , async ( ) => {
50- const md = r4 . resolveFs ( r4Package , "http://hl7.org/fhir/StructureDefinition/markdown" as CanonicalUrl ) ! ;
53+ const md = r4 . resolveFs ( r4Package , "http://hl7.org/fhir/StructureDefinition/markdown" as CanonicalUrl ) ;
54+ if ( ! md ) {
55+ throw new Error ( "markdown type not found" ) ;
56+ }
5157 const ts = ( await registerFsAndMkTs ( r4 , md ) ) [ 0 ] as RegularTypeSchema ;
5258 expect ( ts ) . toMatchObject ( {
5359 identifier : {
@@ -67,9 +73,13 @@ describe("TypeSchema R4 generation", async () => {
6773 const parameters = r4 . resolveFs (
6874 r4Package ,
6975 "http://hl7.org/fhir/StructureDefinition/Parameters" as CanonicalUrl ,
70- ) ! ;
76+ ) ;
77+ if ( ! parameters ) {
78+ throw new Error ( "Parameters resource not found" ) ;
79+ }
7180 const ts = ( await registerFsAndMkTs ( r4 , parameters ) ) [ 0 ] as RegularTypeSchema ;
72- expect ( ts . dependencies ! ) . toContainEqual ( {
81+ expect ( ts . dependencies ) . toBeDefined ( ) ;
82+ expect ( ts . dependencies ) . toContainEqual ( {
7383 kind : "primitive-type" ,
7484 package : "hl7.fhir.r4.core" ,
7585 version : "4.0.1" ,
0 commit comments