-
-
Notifications
You must be signed in to change notification settings - Fork 207
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(eslint-plugin-template): fix fixer of inline templates #1472
fix(eslint-plugin-template): fix fixer of inline templates #1472
Conversation
00ab9c1
to
acfd64a
Compare
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.
Thanks @json-derulo!
When you say you weren't sure where to start... Did you consider adding the cases you reported to the relevant rule's test cases?
You just need to look at the existing tests, duplicate one or more and amend.
We will definitely want to capture your findings as tests before proceeding
acfd64a
to
6842780
Compare
@JamesHenry added a test case |
@json-derulo I meant more capturing the real experience you were having using rules e.g. here #1464 (comment) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1472 +/- ##
==========================================
+ Coverage 89.23% 89.39% +0.16%
==========================================
Files 162 162
Lines 3056 3056
Branches 521 521
==========================================
+ Hits 2727 2732 +5
+ Misses 201 195 -6
- Partials 128 129 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@JamesHenry I am a bit stuck trying to add tests for the real cases. I have tried to setup test cases with the
I have tried to extend from When I use parser Do you have any other idea how I could test this? |
Yes sorry I think I was skipping some relevant complexity here, it probably isn’t a good fit for the unit tests, it would be better as an integration test. I’m on my phone and thinking out loud but I think we could add a relevant file to the generated fixture in one of the existing integration tests and snapshot it before and after applying fixing. If you have time to play around with this idea in the next few days then that’s great, otherwise I can take a proper look this weekend sometime |
6d0c062
to
1b6387e
Compare
@JamesHenry thanks for your input, I think I figured it out by myself. I've implemented an integration test which generates a fresh Angular Workspace and runs Angular ESLint Add schematics. Afterwards, a new test component file is generated with the test cases. I excluded the Not sure why the CI is failing, on my machine the integration tests succeed. Also the failure is related to a different integration test which was not changed. |
3de3fe6
to
0eb07ee
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit ccf6f85. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 7 targets
Sent with 💌 from NxCloud. |
0eb07ee
to
ccf6f85
Compare
@JamesHenry after rebasing the latest changes from the main branch, CI is green now. Could you have a look again to the changes of this PR? |
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.
Great work, thank you @json-derulo!
Currently, the rule fixer does not return correct results for inline templates. It applies to all template rules with a fixer, see #1464 (comment). This is fixed by this PR.
Closes #1464
Note: I wanted to add some tests, but I'm not sure where to start. I performed manual tests of all the cases described in the linked issue.