Jest · Module
stringMatching
expect.stringMatching checks whether a received string matches a string or regular expression. Use it inside Jest matchers such as toEqual, arrayContaining, or objectContaining for flexible matching.
Last updated
Syntax
expect.stringMatching(string | regexp)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expect.not.stringMatchingexpect.arrayContainingexpect.objectContainingtoEqualtoHaveBeenCalledWithtoMatchObject