-
Notifications
You must be signed in to change notification settings - Fork 147
fix: add no-await-sync-events exception for userEvent.keyboard #283
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
Conversation
Hey @ph-fritsche, thanks for your contribution! We need to wait until testing-library/user-event#581 gets merged. Meanwhile, could you add some additional tests to check About disabling the rule in TS environments: the plugin won't detect that for now, so it's up to the user to decide if they want to enable or disable the rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we update a test to include the keyboard
method ? 🤔
I just realized this rule is still pending to be refactored for v4. @ph-fritsche I can include |
Co-authored-by: Michaël De Boey <[email protected]>
@Belco90 I've added the changes necessary. Should be ready to be merged now. 😃 |
LGTM, thanks for your PR and nice work adding this new feature to |
🎉 This PR is included in version 3.10.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@ph-fritsche sorry mate, I forgot to add you as a contributor! @all-contributors please add @ph-fritsche for code |
I could not determine your intention. Basic usage: @all-contributors please add @Someone for code, doc and infra For other usages see the documentation |
@all-contributors please add @ph-fritsche for code |
I've put up a pull request to add @ph-fritsche! 🎉 |
Added exception for the new API proposed in testing-library/user-event#581
Note that with the change
userEvent.type
(anduserEvent.keyboard
) will actually return no Promise if thedelay
is not>0
so that the typing and the actual return value will match.Further it might be worth discussing if this rule should be disabled for
.ts
and.tsx
files asts(80007)
and@typescript-eslint/await-thenable
already warn here and curating a manual list has no benefits when there already are warnings based on the type.