Skip to content
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

Allow by-string matching in throwError #115

Open
pkozlowski-opensource opened this issue Aug 8, 2014 · 2 comments
Open

Allow by-string matching in throwError #115

pkozlowski-opensource opened this issue Aug 8, 2014 · 2 comments

Comments

@pkozlowski-opensource
Copy link

As of today the throwError matcher accepts arguments of type being either:

  • a regexp
  • a function

Personally I find myself quite often matching the error message literally and in this case escaping regexp special chars is a bit of chore. Could we also accept strings as arguments and use the == / === operator to match this string against the error message?

This would definitivelly make my life a bit easier, happy to send a pull request if this meakes sense.

@janmarek
Copy link
Contributor

janmarek commented Nov 1, 2014

Yes please.

@janmarek
Copy link
Contributor

janmarek commented Nov 2, 2014

I have forked this library https://www.npmjs.org/package/expect2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants