Type Alias ParameterTypeOptions

ParameterTypeOptions: {
    name: string;
    preferForRegexpMatch?: boolean;
    regexp: RegExp | string | readonly RegExp[] | readonly string[];
    transformer?: (this: World, ...match: string[]) => unknown;
    useForSnippets?: boolean;
}

Options for defining a custom parameter type.

Type declaration

  • name: string

    The name of the parameter type.

  • OptionalpreferForRegexpMatch?: boolean

    Whether the regular expression(s) for this parameter type should take precedence if used in conjunction with regular expressions for step definitions.

    false
    
  • regexp: RegExp | string | readonly RegExp[] | readonly string[]

    One or more regular expressions which should be used to match the parameter type.

  • Optionaltransformer?: (this: World, ...match: string[]) => unknown

    A function for transforming the matched values to another object before passing to the step function.

    If not provided, the raw matched value(s) will be passed to the step function.

  • OptionaluseForSnippets?: boolean

    Whether this parameter type should be used when suggesting snippets for missing step definitions.

    true