Skip to content
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

feat(rule-tester): port checkDuplicateTestCases from ESLint #9026

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

abrahamguo
Copy link
Contributor

PR Checklist

Overview

Ports checkDuplicateTestCases from ESLint's RuleTester.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @abrahamguo!

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.

Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 4fe40ce
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6634c91b3ea2bd0008c01a3a
😎 Deploy Preview https://deploy-preview-9026--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: 99 (🟢 up 2 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 your Netlify site configuration.

@JoshuaKGoldberg JoshuaKGoldberg added this to the 8.0.0 milestone Apr 29, 2024
@abrahamguo
Copy link
Contributor Author

@JoshuaKGoldberg should this be going into main or v8?
I wasn't sure since in #8211 @bradzacher mentioned this could be merged in ahead of v8.

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the port! 🙌

Just one suggestion on refactoring to a new file. If you don't like it I don't mind, and can merge as-is. Just let me know. 🙂

packages/rule-tester/src/RuleTester.ts Show resolved Hide resolved
packages/rule-tester/src/RuleTester.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg should this be going into main or v8? I wasn't sure since in #8211 @bradzacher mentioned this could be merged in ahead of v8.

👍 Let's do main, as you have it. I had that wonder too. 😄

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 2024
@abrahamguo
Copy link
Contributor Author

abrahamguo commented Apr 29, 2024

@JoshuaKGoldberg one curiosity question — how is this port of RuleTester unit-tested? I was surprised to not see a copy of all ESLint's unit tests against this class, and that I didn't need to add any new tests for the port of this feature.

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 2024
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

D'oh! Sorry, brain fart this morning - there should be tests. See packages/rule-tester/tests/eslint-base/eslint-base.test.js.

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 29, 2024
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team April 30, 2024 20:13
@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Apr 30, 2024
@abrahamguo
Copy link
Contributor Author

There are about 10-20 rules in eslint-plugin which have duplicate tests. Most of them seem to be merging multiple combinations of auto-generated tests together. I'm working on fixing them, but let me know if you have any thoughts on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement(rule-tester): detect duplicate test cases
2 participants