Skip to content

refactor(consistent-data-testid): use createTestingLibraryRule #362

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

Merged
merged 4 commits into from
Apr 27, 2021

Conversation

MichaelDeBoey
Copy link
Member

I didn't add tests for the new skipRuleReportingCheck detection option (yet) as I don't know how to test that one.

@Belco90 could you point me in the right direction of how I would add tests for it?


This PR does some ground work for #358

Copy link
Member Author

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

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

I don't understand why GH is saying that detect-testing-library-utils.ts is a new file, as I only changed these parts and moved the file to the create-testing-library-rule folder

@Belco90
Copy link
Member

Belco90 commented Apr 27, 2021

I don't understand why GH is saying that detect-testing-library-utils.ts is a new file, as I only changed these parts and moved the file to the create-testing-library-rule folder

Could you avoid moving the file then? It's doing more harm than good, and we can move it in a different PR to avoid adding more noise here.

@Belco90
Copy link
Member

Belco90 commented Apr 27, 2021

@Belco90 could you point me in the right direction of how I would add tests for it?

Sure! All current consistent-data-testid tests must pass. You should duplicate some of the current cases, both valid and invalid ones, but switching Aggressive Reporting off through settings property, and the test result should be exactly the same as the original test case. This way you check that Aggressive Reporting and canReportErrors doesn't affect consistent-data-testid rule since it's passing the new skip option.

Let me know if you need more assistance over this!

edit: remove non-necessary explanation about how to implement the check itself

@MichaelDeBoey MichaelDeBoey requested a review from Belco90 April 27, 2021 15:41
@MichaelDeBoey MichaelDeBoey force-pushed the update-consistent-data-testid branch from 3783036 to 3685215 Compare April 27, 2021 15:43
@Belco90 Belco90 merged commit 42d84c9 into main Apr 27, 2021
@Belco90 Belco90 deleted the update-consistent-data-testid branch April 27, 2021 17:07
@github-actions
Copy link

github-actions bot commented May 3, 2021

🎉 This PR is included in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants