Skip to content

fix: allow un-called async util references #1061

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 3 commits into from
Aug 12, 2025

Conversation

puglyfe
Copy link
Contributor

@puglyfe puglyfe commented Aug 8, 2025

Checks

Changes

This prevents false positives for the case where async utils are referenced but not called. This matches the behavior in both await-async-events and await-async-queries. await-async-events explicitly tests for this behavior here and here. await-async-queries doesn't explicitly test for this, but follows a similar implementation of only processing CallExpression nodes rather than CallExpression Identifier nodes.

  • Allow un-called references in await-async-utils
  • Add tests to await-async-queries to prevent regressions in existing behavior

Context

fixes #1060

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@079043b). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1061   +/-   ##
=======================================
  Coverage        ?   96.44%           
=======================================
  Files           ?       50           
  Lines           ?     2698           
  Branches        ?     1115           
=======================================
  Hits            ?     2602           
  Misses          ?       96           
  Partials        ?        0           

☔ 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 11, 2025 07:01
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.

Good catch! LGTM, but you need to increase the code coverage a bit to make codecov happy 😅

@puglyfe puglyfe requested a review from Belco90 August 11, 2025 14:52
@Belco90 Belco90 added the bug Something isn't working label Aug 12, 2025
@Belco90 Belco90 merged commit 5f6adb3 into testing-library:main Aug 12, 2025
31 checks passed
Copy link

🎉 This PR is included in version 7.6.5 🎉

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-utils flags un-called function references
2 participants