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
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.
The text was updated successfully, but these errors were encountered:
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 anawait
causes the typescript rule to complain.Trying to pick apart the code, as far as I can tell once a function,
fn
, is wrapped ininstrument
it will return a promise if and only if the originalfn
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 theawait-interactions
rule seems redundant.The text was updated successfully, but these errors were encountered: