* 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. * @param name The name of the option (may be used in error messages). * @param option The option value. * @param predicate
(name: string, option: O | undefined, predicate: AsyncOptionPredicate<T, O>)
| 664 | * @return this (for method chaining). |
| 665 | */ |
| 666 | addOption<O>(name: string, option: O | undefined, predicate: AsyncOptionPredicate<T, O>) { |
| 667 | if (option !== undefined) { |
| 668 | this.add(`${name} = ${_valueAsString(option)}`, item => predicate(item, option)); |
| 669 | } |
| 670 | return this; |
| 671 | } |
| 672 | |
| 673 | /** |
| 674 | * Filters a list of harnesses on this predicate. |