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
thisAdds a predicate function to be run against candidate harnesses.
stringA description of this predicate that may be used in error messages.
thisaddOption
thisAdds 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.
stringThe name of the option (may be used in error messages).
O | undefinedThe option value.
AsyncOptionPredicate<T, O>The predicate function to run if the option value is not undefined.
thisfilter
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.
TThe harness to check
Promise<boolean>getDescription
stringGets a description of this predicate for use in error messages.
stringgetSelector
stringGets the selector used to find candidate elements.
stringstringMatches
Promise<boolean>Checks if the specified nullable string value matches the given pattern.
string | Promise<string | null> | nullThe nullable string value to check, or a Promise resolving to the nullable string value.
string | RegExp | nullThe 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>