Skip to content

fix: Aggressive Reporting support in resolveToTestingLibraryFn #1043

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

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

Conversation

y-hsgw
Copy link
Member

@y-hsgw y-hsgw commented Jul 13, 2025

Checks

Changes

  • Fix matching logic for testing-library/utils-module in resolveToTestingLibraryFn

Context

Fixes #1038

Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.46%. Comparing base (7812dae) to head (b6b14fe).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1043      +/-   ##
==========================================
- Coverage   96.48%   96.46%   -0.03%     
==========================================
  Files          49       50       +1     
  Lines        2678     2686       +8     
  Branches     1110     1106       -4     
==========================================
+ Hits         2584     2591       +7     
- Misses         94       95       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

const hasImportModuleMatch =
[...LIBRARY_MODULES, USER_EVENT_MODULE].includes(maybeImport.source) ||
(typeof customModuleSetting === 'string' &&
maybeImport.source.endsWith(customModuleSetting));
Copy link
Member

Choose a reason for hiding this comment

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

There are several utils related to detect Testing Library modules in lib/create-testing-library-rule/detect-testing-library-utils.ts, perhaps we can reuse something here?

If not, we probably need to combine that module with this one at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're absolutely right.
Taking this opportunity, I implemented a function(isTestingLibraryModule)to detect Testing Library modules.

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.

no-node-access rule output false-positive warning for FireEvent after 7.5.4
2 participants