-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix(getQueryNodeFrom): move Identifier
type checks to getInnerNodeFrom
#255
fix(getQueryNodeFrom): move Identifier
type checks to getInnerNodeFrom
#255
Conversation
Codecov Report
@@ Coverage Diff @@
## main #255 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 581 581
Branches 167 165 -2
=========================================
Hits 581 581
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Identifier
type checks to getInnerNodeFrom
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.
Can you add a few test cases please?
trying to pick this up again in my free time, do you have some existing unit test examples that I can take a look at for reference?? |
@ricardozv28 tests for rules live here - you don't need to add tests to every rule, but we should have a couple if possible (including one here for |
🎉 This PR is included in version 5.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
Move logic for checking if expression type is Identifier to getInnerNodeFrom method
Why:
As reported on issue #203, features like
.toBeDisabled()
are not getting recommend as fixes for code like the following:How:
After a little bit of digging, I noticed that when using
getByRole
method the type of the expression that was getting passed to getInnerNodeFrom was aMemberExpression
, which was being handled by in the switch statement,expression.object
was getting passed now to getInnerNodeFrom which was the type of 'Identifier' but since that case is not getting handled in the method, the returned expression didn't have a property.callee
which was makinggetQueryNodeFrom
to returnisDTLQuery
as falseChecklist:
Fix #203