-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add toBeHexadecimal Method #149
Comments
Hey @mvpowers I like the sound of this matcher, feel free to send a PR 😄 |
@mvpowers @mattphillips Not that I oppose the idea, but shouldn't this be implemented as a simple
|
@denizdogan I think this matcher is a useful one to save people having to write out the regex and reads nicer than |
It's too late for this comment I guess, but hexadecimal notation can look different in different languages. CSS is the only one I know of that uses |
@denizdogan I'm happy to extend out it's behaviour to support other languages if you want to send a PR? |
@mattphillips I'm not really interested in sending a P.R. for this particular method (I would have just used the regex version I suggested earlier) but I'm just pointing out that "being hexadecimal" is a broad term and if the method is supposed to check that the value is a valid hexadecimal CSS value of length 3 or 6, it would be good if that was reflected somewhere in the documentation too. |
Feature Request
Description: Add a method to check whether a string is a valid hexadecimal.
Possible solution:
expect('#e3e3e3').toBeHexadecimal();
expect('#fff').toBeHexadecimal();
This could be helpful for some front-end tests. I'll be happy to submit a PR if this sounds like a good idea.
The text was updated successfully, but these errors were encountered: