-
-
Notifications
You must be signed in to change notification settings - Fork 508
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(js_formatter): updated the is_test_call_expression function to match prettier #4811
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #4811 will not alter performanceComparing Summary
|
in ci
I don't understand why this error occurs, even though the issue-4202.js.prettier-snap file exists. |
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.
The tests in specs/prettier
are synced with the prettier repo. You should move your new snapshot tests outside of that folder into specs/js
.
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.
@mdm317 Also, you should add template literals to the tests, since they are part of the new logic
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.
@dyc3
Thank you for letting me know. It was really helpful!
@ematipico
Thank you for the review. I have one question.
Lines 19 to 21 in a658a29
it(`does something really long and complicated so I have to write a very long name for the test`, function () { console.log("hello!"); });
Template literals are already exist, and the results won't change.
Should I still add them?
If I misunderstood something, please let me know.
@mdm317 can you please add another test case with template literals? |
Summary
fixes #4202
For Prettier, assume it is a Testcall only if the first argument is a StringLiteral or TemplateLiteral.
So, I added the logic.
However, assuming that it is not a Testcall if the first argument is neither a StringLiteral nor a TemplateLiteral might have some edge cases.
Please share your thoughts.
Test Plan
add test