@samatawy/rules
    Preparing search index...

    Interface TestsFileReaderOptions

    Options for configuring the behavior of the TestsFileReader when parsing tests from a file.

    interface TestsFileReaderOptions {
        read_by: "block" | "line";
        workspace?: Workspace;
        accept: "all" | "partial";
    }

    Hierarchy (View Summary)

    Index

    Properties

    read_by: "block" | "line"

    Determines whether to read the file content line by line or block by block (separated by empty lines). This allows for flexible formatting of the file, where each entry can either be defined on a single line or as a block of text.

    • 'line': Read the file content line by line, where each line is considered a separate entry to parse. Empty lines will be skipped.
    • 'block': Read the file content block by block, where blocks are separated by one or more empty lines. Each block (which can consist of multiple lines) is considered a separate entry to parse. Empty blocks will be skipped.
    workspace?: Workspace

    Optional reference to the Workspace instance, which can be used by the RuleParser to access existing rules, types, functions, and constants when parsing rules from the file. This allows for more complex rule definitions that can reference other components within the Workspace.

    accept: "all" | "partial"

    Determines whether to accept all test cases (including invalid ones) or only fully valid test cases.

    • 'all': Accept all test cases, but include errors for any invalid test cases. The resulting test cases object will include only the successfully parsed test cases, and the errors array will contain messages for any test cases that failed to parse.
    • 'partial': Only accept test cases if all of them are valid. If any test case fails to parse, the entire parsing process will be considered a failure, and the resulting test cases object will be empty while the errors array will contain messages for all failed test cases.