testing-library / eslint-plugin-testing-library

ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library
https://npm.im/eslint-plugin-testing-library
MIT License
992 stars 142 forks source link

feat(no-await-sync-queries): add auto-fix #919

Open neriyarden opened 4 months ago

neriyarden commented 4 months ago

Checks

Changes

Do we want to remove the async from the test callback when there's no other awaits in it?

Context

Fixes an item in #202

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.34%. Comparing base (93a6ab9) to head (6120e73). Report is 23 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #919 +/- ## ========================================== + Coverage 96.23% 96.34% +0.10% ========================================== Files 44 46 +2 Lines 2419 2489 +70 Branches 1000 1030 +30 ========================================== + Hits 2328 2398 +70 Misses 91 91 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

neriyarden commented 1 month ago

@G-Rath Good catch and thanks for the review 🙂 I removed the space after the await in the fixer and updated the tests. I also added a test cade for the example you gave (await(getByIcon('search')))

Let me know what you think:)