-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
t.throws RegExp not matching correctly #269
Comments
@Jameskmonger This works with the so, in your case, it would be |
I've added some tests that demonstrate this, and will close the issue. |
(also, dupe of #182) |
Thanks @ljharb |
This behavior really should be in the documentation so everyone isn't having to rediscover it. Right now all it says is "expected, if present, must be a RegExp or Function." |
I have two tests:
The first test passes, as expected, because I don't specify the start and end of the RegExp matcher using
^
and$
. The second, however, should no longer match the whole error message and should fail. These two behave as expected.When I add a third test, however:
I expect this to pass, because the whole string matches the RegExp. The test fails with the following output:
The text was updated successfully, but these errors were encountered: