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

await-interactions seems redundant #109

Open
XuluWarrior opened this issue Nov 29, 2022 · 0 comments
Open

await-interactions seems redundant #109

XuluWarrior opened this issue Nov 29, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@XuluWarrior
Copy link

I've been debugging an issue where the await-interactions rule and @typescript-eslint/await-thenable conflict.
The type declarations of userEvent.click state that it returns void and so adding an await causes the typescript rule to complain.

Trying to pick apart the code, as far as I can tell once a function, fn, is wrapped in instrument it will return a promise if and only if the original fn returned a promise. So assuming that it is always awaitable seems wrong.

Certainly, when I run and debug userEvent.click() in my story it returns 'undefined' rather than a Promise.

If the types in @storybook/testing-library are correct then @typescript-eslint/no-floating-promises would ensure that all Promises are awaited and the await-interactions rule seems redundant.

@yannbf yannbf added the bug Something isn't working label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants