-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(expectations): add toMatch #191
Conversation
What if we just call it Then let me do the following expect('Hello World')->toMatch('/^hello wo.*$/i');
expect('Hello World')->toMatch('Hello World'); So a regex and a string is supported for matching. |
@olivernybroe, that makes sense too. 👍🏻 Although, I wonder if people might get confused between |
@owenvoke Hmm true. Could we extend |
So, to give context. Normally, we mimic the API of Jest. In this case, Jest don't have this feature. So let's take a moment to actually make sure we don't make a mistake here. JavaScript uses I think we can use |
@nunomaduro According to jest they use |
@owenvoke @olivernybroe If Jest uses |
Pushed an update. 👍🏻 |
Fell free to merge, tag a new version, update the docs, and make a tweet about it @owenvoke . |
@nunomaduro, I noticed you merged the docs for |
@owenvoke Yes. |
I wasn't sure about the naming of this, whether it should be
toMatchRegEx
,toMatchRegExp
, ortoMatchRegularExpression
. (ThetoBe*
prefix doesn't really work with any of them).