Skip to content

Consider enforcing non-empty assertions arrays in annotations/test.schema.json #860

@SHUBHANSHU602

Description

@SHUBHANSHU602

While reviewing annotations/test.schema.json, I noticed that the assertions property is defined as:
"assertions": { "type": "array", "items": { "$ref": "./assertion.schema.json" } }
However, there is currently nominItemsconstraint. This means a test of the form:

{ "instance": {}, "assertions": [] }

would be considered valid according to the schema.

From a structural perspective, a test with an empty assertions array does not appear to verify any behavior and would therefore always pass trivially. That may be acceptable if intentional, but it could also allow accidental empty tests to slip into the suite unnoticed.

Happy to raise PR !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions