Skip to content
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

fix: no-await-sync-events false positive #641

Conversation

sjarva
Copy link
Collaborator

@sjarva sjarva commented Sep 7, 2022

Checks

  • I have read the contributing guidelines.
  • If some rule is added/updated/removed, I've regenerated the rules list (npm run generate:rules-list)
  • If some rule meta info is changed, I've regenerated the plugin shared configs (npm run generate:configs)

Changes

  • Check if delay is declared or assigned a value elsewhere than in the call expression's arguments
  • Add test cases that have declarations and assignments

Context

Closes #403

Check if delay is declared or assigned a value elsewhere than in the call expression's arguments.
Add test cases that have declarations and assignments.

Ref: testing-library#403
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.

Nice! Thanks for taking care of this bug @sjarva 👏

@sjarva
Copy link
Collaborator Author

sjarva commented Sep 7, 2022

Oh wow, that must have been the fastest review in my life @Belco90 🥳 🎈 Thank you so much!

@Belco90 Belco90 merged commit 3c2cbbd into testing-library:main Sep 7, 2022
@Belco90
Copy link
Member

Belco90 commented Sep 7, 2022

It was a coincidence to be honest! I opened GitHub to check something else, and I saw this short PR 🚀

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

🎉 This PR is included in version 5.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ph-fritsche
Copy link
Member

ph-fritsche commented Sep 7, 2022

With user-event@14 this rule should probably be removed, as all APIs are asynchronous.

@sjarva sjarva deleted the pr/no-await-sync-events-false-positive-fix branch September 7, 2022 12:12
@Belco90
Copy link
Member

Belco90 commented Sep 7, 2022

With user-event@14 this rule should probably be removed, as all APIs are asynchronous.

It won't be removed yet, but we planned to adapt another rule to handle async user event method properly #626

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.

False positive for testing-library/no-await-sync-events
3 participants