Skip to content

Conversation

puglyfe
Copy link
Member

@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

Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.53%. Comparing base (086eab9) to head (fbfff97).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1056      +/-   ##
==========================================
+ Coverage   96.44%   96.53%   +0.08%     
==========================================
  Files          50       50              
  Lines        2704     2768      +64     
  Branches     1112     1153      +41     
==========================================
+ Hits         2608     2672      +64     
  Misses         96       96              

☔ 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.

@Belco90 Belco90 self-requested a review August 12, 2025 05:35
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

@puglyfe LGTM in general! Can you update the branch, so I can give it a final review and merge? Thanks!

@puglyfe puglyfe requested a review from Belco90 September 21, 2025 02:45
@puglyfe puglyfe requested a review from Belco90 September 22, 2025 04:23
@Belco90 Belco90 changed the title fix: improve detection of userEvent.setup() calls fix(await-async-events): improveuserEvent.setup() detection Sep 22, 2025
@Belco90 Belco90 added the bug Something isn't working label Sep 22, 2025
@Belco90 Belco90 merged commit 742cd11 into testing-library:main Sep 22, 2025
31 checks passed
Copy link

🎉 This PR is included in version 7.8.1 🎉

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
bug Something isn't working released
Projects
None yet
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()
2 participants