-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(eslint-plugin): consistently use it
in tests
#10680
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
Conversation
Changes a few occurrences of `test(name, fn)` to use `it(name, fn)` for consistency with the rest of the codebase.
Thanks for the PR, @43081j! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
View your CI Pipeline Execution ↗ for commit ae4333c.
☁️ Nx Cloud last updated this comment at |
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!
it
in testsit
in tests
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.
-0.5 from me, but if the rest of the team disagrees I don't mind this being merged at all. Thanks for sending!
expect(areOptionsValid(exampleRule, ['value-a'])).toBe(true); | ||
}); | ||
|
||
describe('returns false for invalid options', () => { | ||
test('bad enum value', () => { | ||
it('bad enum value', () => { |
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 actually like test()
here over it()
. The test name doesn't grammatically read out as a full sentence. I've personally kind of gravitated towards:
it()
: for most tests, if there's at all a way to phrase it as "it X when Y" or something like thattest()
: as a fallback if there's no logic, just a descriptor - like "test X"
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 don't really care which one we use as long as it is one, and not two
If you can get the others to agree, I'm happy to update
I don't think you should end up with both. What you say makes sense but, if anything, suggests you would prefer having test
throughout
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.
Oh don't get me wrong, I think it()
is the right choice almost all of the time. Just my personal nitpicky preference is to use test()
in specific situations. 😄
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.
To be honest, my preference is actually suite/test/assert. But the most consistent thing we can do right now is it
it seems
As a middle ground, id prefer to later move from the now-consistent it
to test
if anything
Oh, I apologize, I made a mistake here. I had assumed that this was a necessary change for moving to vitest, because of its inclusion in #10579. However, now that I realize that vitest has
Sincere apologies again to @43081j for my misunderstanding and for requesting this PR only to close it 🙁 And thank you to @JoshuaKGoldberg for pointing out my mistake! |
Changes a few occurrences of
test(name, fn)
to useit(name, fn)
for consistency with the rest of the codebase.PR Checklist