Open sergiuchuckmisha opened 5 years ago
👍
Is there any update regarding this issue?
I would definitely push for the removal of the size requirement for the toBeHexadecimal
matcher, especially because the current matcher is not even working with the "new" format of hexadecimal colors that can have up to 8 chars (when having alpha information for the color).
In this case, we could have:
toBeHexadecimal()
as a matcher for any hexadecimal stringtoBeHexColor()
as a matcher for hexadecimal color strings having 3 to 8 charsAnother solution would be to have only toBeHexadecimal
as a matcher for all hexadecimal string with an optional parameter with a maximum amount of chars for the provided string.
First of all: I understand that, according to documentation, behavior is correct. What I mean is that name of method
toBeHexadecimal
is disguise.toBeHTMLHexadecimalColor
ortoBeHexadecimalColor
would be better naming.Bug
package
version: "jest-extended": "^0.11.1"node
version: v10.13.0npm
version: 6.4.1Relevant code or config
What you did: tried to verify is string a valid hash
What happened (please provide anything you think will help): test failed Reproduction repository (if possible): not possible
Possible solution:
rename
toBeHexadecimal
totoBeHTMLHexadecimalColor
or totoBeHexadecimalColor
possibly, add method
toBeHexadecimal
which checks if a value is a valid hexadecimal string.