Test a string to be equal to a specified string. @param expected - Expected value to match.
(expected: S)
| 163 | @param expected - Expected value to match. |
| 164 | */ |
| 165 | equals<S extends string>(expected: S): Predicate<S> { |
| 166 | return this.addValidator({ |
| 167 | message: (value, label) => `Expected ${label} to be equal to \`${expected}\`, got \`${value}\``, |
| 168 | validator: value => value === expected, |
| 169 | }) as unknown as Predicate<S>; |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | Test a string to be alphanumeric. |
no test coverage detected