Interface PeggyTestOptions<T>

interface PeggyTestOptions<T> {
    invalid?: string;
    invalidInput?: string;
    only?: boolean;
    options?: ParserOptions & ExtraParserOptions;
    peg$maxFailPos?: number;
    skip?: boolean;
    startRule?: string;
    validInput?: string;
    validResult?: T | (res: T) => any;
}

Type Parameters

  • T

Properties

invalid?: string

What to append to validInput to make it invalid, so that library mode will return a prefix match.

invalidInput?: string

If specified, ensure that the grammar fails on this input.

only?: boolean

If any test has this set to true, only run the tests with this set to true.

options?: ParserOptions & ExtraParserOptions

Extra options to pass to parse(), overriding whatever else this library would have otherwise used.

peg$maxFailPos?: number

Expected peg$maxFailPos.

skip?: boolean

If true, skip this test.

startRule?: string

Which valid start rule to use? Default: grammar default start rule.

validInput?: string

If specified, check this against the startRule.

validResult?: T | (res: T) => any

What result should startRule return for validInput? Default: validInput.