Jest · Matcher
toMatch
Jest's toMatch matcher checks whether a string matches a regular expression or contains supplied text. Add .not to require that it does not match.
Last updated
Syntax
expect(value).toMatch(regexp | string)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectnottoBetoEqualtoMatchObjectstringMatching