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
Chore: Refactor CLIEngine tests (refs #13481) #13709
Conversation
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.
Looks good, I left some questions.
Feedback addressed. |
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 saw two inconsistencies in your beforeEach
/afterEach
patterns. Not sure if that falls under the category of looking out of place, so I'll leave it to you to decide how much you care that they all follow the same pattern.
I left a code suggestion for a .skip
that will demonstrate the broken ../.eslintrc.json
not being cleaned up after its test. Hopefully that's enough to help you diagnose. Once that's resolved, LGTM.
Helpful tip for future reviewers: updating the your comparison view settings to ignore whitespace will shave a few hundred lines off the diff.
Updated to:
|
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.
Works for me! LGTM
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.
Just two small notes. LGTM if you think there's no need to fix those at the moment.
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
Refactored a test
What changes did you make? (Give an overview)
I removed the in-memory file system from the
CLIEngine
tests and replaced it with an actual filesystem. This is important for working on simple config because the in-memory filesystem does all kinds of complicated things to "fake" a filesystem, and it's impossible to reuse that to test that simple config doesn't break anything.This change keeps all of the tests working the exact same way they did previously, only with an actual filesystem. That will allow me to eventually start using exports from
@eslint/eslintrc
insideCLIEngine
and tell if I broke anything.I'll need to do the same for the rest of the places in the tests where in-memory filesystems are used, so this is the first of a few such refactors.
Is there anything you'd like reviewers to focus on?
Anything obvious look out of place?