You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a design decision to enforce all expect calls to be awaited, but it's not even covered fully (e.g. it won't trigger the rule if it's expect(…).not.toBe(…) where the pattern of CallExpression>MemberExpression>CallExpression, which this chunk above detects is not preserved)
I went through the history of changes, of the rule, and I see that expect initially was one of FUNCTIONS_TO_BE_AWAITED but then some refinements came, but I'm not sure why was it considered as "it needs to be awaited" at all - it's not at all obvious it should
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/[email protected]
@testing-library/[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: