-
Notifications
You must be signed in to change notification settings - Fork 53
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: false positive and bad fix if await result is passed to expect in one line #136
Comments
After a brief look into the rule code I can narrow the cause of what I see as a problem down to this section: eslint-plugin-storybook/lib/rules/await-interactions.ts Lines 101 to 109 in 611b70e
There's a design decision to enforce all I went through the history of changes, of the rule, and I see that |
Describe the bug
Rule reports problem on following code:
if it's written this way:
rule doesn't complain.
Fix is proposed to prepend
expect((await promise).foo).toBe('bar')
which is incorrect as it doesn't need that in the first place.That's true Jest expect can be awaited, but then
should become
and fixer just prepends the
await
keywordAdditional context
@storybook/testing-library@0.2.0
@testing-library/user-event@14.4.3
eslint-plugin-storybook@0.6.12
The text was updated successfully, but these errors were encountered: