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

fix: improve detection of userEvent.setup() calls #1056

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
puglyfe wants to merge 4 commits into testing-library:main
base: main
Choose a base branch
Loading
from puglyfe:fix-setup-async-methods

Conversation

Copy link
Contributor

@puglyfe puglyfe commented Aug 2, 2025

Checks

Changes

  • Improve detection of async event methods called on userEvent sessions

Context

I had a little bit of familiarity with this from a previous fix, so figured I would take a shot at resolving the issue. There are a huge number of edge cases in trying to support this pattern, and I almost certainly haven't covered them all. But I specifically addressed the example in the original bug report as well as the related example that's shown in the testing-library docs.

Fixes #812

Belco90 reacted with heart emoji
Copy link

codecov bot commented Aug 2, 2025
edited
Loading

Codecov Report

❌ Patch coverage is 98.73418% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.52%. Comparing base (2e7e1b6) to head (347b2cd).

Files with missing lines Patch % Lines
lib/rules/await-async-events.ts 98.48% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## main #1056 +/- ##
==========================================
+ Coverage 96.46% 96.52% +0.05% 
==========================================
 Files 50 50 
 Lines 2687 2760 +73 
 Branches 1112 1154 +42 
==========================================
+ Hits 2592 2664 +72 
- Misses 95 96 +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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Belco90 Belco90 Awaiting requested review from Belco90

At least 1 approving review is required to merge this pull request.

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

await-async-events doesn't seem to check calls from user sessions returned by userEvent.setup()
1 participant

AltStyle によって変換されたページ (->オリジナル) /