@samatawy/rules
    Preparing search index...

    Class TestParser

    Parser class for parsing test cases from DSL syntax into AbstractTestCase objects. This parser is designed to handle test cases that can be used to test workspaces. The expected syntax for test cases is DSL-based, where an AbstractTestCase must have a "TEST input object" clause and either an "EXPECT output object" or an "EXPECT ERRORS array" clause. The parser includes validation to ensure that the provided DSL syntax conforms to the expected structure for test cases.

    Index

    Constructors

    Methods

    • Parse a test case from its DSL syntax string and return the corresponding AbstractTestCase object. Should be able to read strict and relaxed JSON syntax for test cases, such as: { "key": "Person", "type": "object", "properties": { "name": "string", "age": "number" } } or with relaxed JSON syntax like: { key: 'Person', type: 'object', properties: { name: 'string', age: 'number' } }

      Parameters

      • syntax: string

        The DSL syntax string of the test case to parse.

      Returns AbstractTestCase

      The parsed AbstractTestCase object if successful.

      An error if the syntax is invalid or if parsing fails for any reason.