Skip to content

fix: allow un-called async util references#1061

Merged
Belco90 merged 3 commits into
testing-library:mainfrom
puglyfe:allow-async-refs
Aug 12, 2025
Merged

fix: allow un-called async util references#1061
Belco90 merged 3 commits into
testing-library:mainfrom
puglyfe:allow-async-refs

Conversation

@puglyfe

@puglyfe puglyfe commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator

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

Comment thread tests/lib/rules/await-async-queries.test.ts
@codecov

codecov Bot commented Aug 8, 2025

Copy link
Copy Markdown

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

@Belco90 Belco90 left a comment

Copy link
Copy Markdown
Member

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
@github-actions

Copy link
Copy Markdown

🎉 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