Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(eslint-plugin): consistently useit 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

43081j
Copy link
Contributor

Changes a few occurrences oftest(name, fn) to useit(name, fn) for consistency with the rest of the codebase.

PR Checklist

kirkwaiblinger reacted with thumbs up emoji
Changes a few occurrences of `test(name, fn)` to use `it(name, fn)` forconsistency with the rest of the codebase.
@typescript-eslint
Copy link
Contributor

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 onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedJan 18, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitae4333c
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/678bc2db5a97cd0008a0ec2e
😎 Deploy Previewhttps://deploy-preview-10680--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJan 18, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commitae4333c.

CommandStatusDurationResult
nx run-many --target=build --exclude website --...✅ Succeeded56sView ↗
nx run-many --target=clean✅ Succeeded11sView ↗

☁️Nx Cloud last updated this comment at2025-01-19 16:27:44 UTC

Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM!

@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelJan 19, 2025
@kirkwaiblingerkirkwaiblinger changed the titletest(eslint-plugin): consistently useit in testschore(eslint-plugin): consistently useit in testsJan 19, 2025
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a 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', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🤔 I actually liketest() here overit(). 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 that
  • test(): as a fallback if there's no logic, just a descriptor - like"test X"

Copy link
ContributorAuthor

@43081j43081jJan 19, 2025
edited
Loading

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 havingtest throughout

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 thinkit() is the right choice almost all of the time. Just mypersonal nitpicky preference is to usetest() inspecific situations. 😄

Copy link
ContributorAuthor

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 isit it seems

As a middle ground, id prefer to later move from the now-consistentit totest if anything

@kirkwaiblinger
Copy link
Member

Oh, I apologize, I made a mistake here. I had assumed that this was anecessary change for moving to vitest, because of its inclusion in#10579. However, now that I realize that vitest hastest() also I don't think we should do this as part of the vitest effort, sorry. It's just noise on unrelated changes. My opinion is that we should

  1. Not proceed with this PR
  2. Remove thetest() ->it() changes fromchore(eslint-plugin): migrate to vitest #10579

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!

@43081j43081j deleted the consistent-tests branchJanuary 20, 2025 10:21
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJan 28, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@kirkwaiblingerkirkwaiblingerkirkwaiblinger approved these changes

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@43081j@kirkwaiblinger@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp