Skip to content

Conversation

puglyfe
Copy link
Contributor

@puglyfe puglyfe commented Aug 8, 2025

Checks

Changes

  • replaces hasChainedThen with hasChainedPromiseHandler in the isPromiseHandled logic
  • adds tests to all async rules that utilize this code path

I'm a bit curious if there's a reason why this pattern wasn't supported previously. I know it's possible to rewrite tests to use async matchers, but this seems like something that the plugin should allow. Let me know if there's something I'm not considering here...

edit: github cached the PR title from my previous contribution 🤔 not sure what happened there.

Context

closes #1058

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.47%. Comparing base (2e7e1b6) to head (48eeefc).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1059   +/-   ##
=======================================
  Coverage   96.46%   96.47%           
=======================================
  Files          50       50           
  Lines        2687     2693    +6     
  Branches     1112     1116    +4     
=======================================
+ Hits         2592     2598    +6     
  Misses         95       95           

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

@puglyfe puglyfe changed the title fix: handled promises assigned to vars are valid fix: catch handles promise Aug 8, 2025
@Belco90 Belco90 self-requested a review August 11, 2025 07:12
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.

This is great, thanks for your contribution!

@Belco90 Belco90 merged commit 5e7b9a3 into testing-library:main Sep 3, 2025
31 checks passed
Copy link

github-actions bot commented Sep 3, 2025

🎉 This PR is included in version 7.6.8 🎉

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.

Promises with catch are not considered handled
2 participants