String Verifier Reference
Created by should().string(entry: string | null | undefined).
Methods
Method | Passes when |
|---|---|
| strictly equal, case-sensitive |
| equal after upper-casing both sides (skips the definedness guard — see Caveats) |
| starts with |
| ends with |
|
|
| zero length (sugar for |
| empty, or only space characters after removal |
|
|
|
|
| occurrence count of |
| same, case-insensitive |
| contains at least one of the arguments |
| same, case-insensitive |
|
|
Plus the inherited not and defined().
Times counters
Times builds the counter predicates for the contains family:
Helper | Predicate |
|---|---|
|
|
|
|
|
|
|
|
|
|
Any custom (count: number) => boolean may be passed instead.
Representative messages
`'${expected}' doesn't equal '${real}'.`(equals)`'${real}' doesn't start with '${expected}'.`/`'${real}' doesn't end with '${expected}'.`(startsWith/endsWith)`'${real}' is not whitespace.`/`'${real}' is not uppercased.``'${real}' does not match ${exp}.`(match)
Guide: Strings.