File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ describe("v3.2", () => {
5252 await expect ( oad ) . to . not . matchJsonSchema ( "./src/schemas/validation/schema.yaml" ) ; // <-- "schema.yaml" instead of "schema-base.yaml"
5353 } ) ;
5454
55+ test ( "unreachable branch in Reference Object" , async ( ) => {
56+ // The Reference Object schema is only conditionally reached if the instance is an object,
57+ // so the `type: object` line will never fail unless "directly" tested with a non-object instance.
58+ const invalidReferenceObject = 42 ;
59+ await expect ( invalidReferenceObject ) . to . not . matchJsonSchema ( "./src/schemas/validation/schema.yaml#/$defs/reference" ) ; // <-- "schema.yaml" instead of "schema-base.yaml"
60+ } ) ;
61+
5562 describe ( "Pass" , ( ) => {
5663 readdirSync ( `${ fixtures } /pass` , { withFileTypes : true } )
5764 . filter ( ( entry ) => entry . isFile ( ) && / \. y a m l $ / . test ( entry . name ) )
You can’t perform that action at this time.
0 commit comments