HarnessPredicate
A class used to associate a ComponentHarness class with predicate functions that can be used to filter instances of the class to be matched.
constructor
HarnessPredicate<T>
HarnessPredicate<T>
harnessType
ComponentHarnessConstructor<T>
add
this
Adds a predicate function to be run against candidate harnesses.
string
A description of this predicate that may be used in error messages.
this
addOption
this
Adds a predicate function that depends on an option value to be run against candidate harnesses. If the option value is undefined, the predicate will be ignored.
string
The name of the option (may be used in error messages).
O | undefined
The option value.
AsyncOptionPredicate<T, O>
The predicate function to run if the option value is not undefined.
this
filter
Promise<T[]>
Filters a list of harnesses on this predicate.
T[]
The list of harnesses to filter.
Promise<T[]>
evaluate
Promise<boolean>
Evaluates whether the given harness satisfies this predicate.
T
The harness to check
Promise<boolean>
getDescription
string
Gets a description of this predicate for use in error messages.
string
getSelector
string
Gets the selector used to find candidate elements.
string
stringMatches
Promise<boolean>
Checks if the specified nullable string value matches the given pattern.
string | Promise<string | null> | null
The nullable string value to check, or a Promise resolving to the nullable string value.
string | RegExp | null
The pattern the value is expected to match. If pattern
is a string,
value
is expected to match exactly. If pattern
is a regex, a partial match is
allowed. If pattern
is null
, the value is expected to be null
.
Promise<boolean>