forked from enzymejs/enzyme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes enzymejs#590: change isCompoundSelector to not match prop selector
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26c155b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't match:
What's wrong with
/^[\.#]?-?[_a-z]+[_a-z0-9-]*[\.\[#]/i
?I acknowledge that it can return true for a malformed selector but is it any worse than the alternative: for the regex test to say "I've parsed this (malformed) selector and I can tell you it is not compound." They're both wrong so we might as well go with the simpler one.
26c155b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
26c155b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it and added more test cases
26c155b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You smell that? It's the sweet smell of a painless contribution.
Other projects require you to sacrifice a chicken and a goat for them to fix anything.
Thanks.