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 found that I had some usages of to.equalSnapshot not awaited and that causes some weird behaviors:
Failures show up like "An error was thrown in a Promise outside a test" but the test passes
Failure do not show up at all sometimes
When awaited I get false negative TS warnings: await has no effect on the type of this expression.
I think this needs two tweaks:
Adjust the return type of snapshot functions to help IDE understand the are async
Add an eslint rule to prevent them from being unawaited
The second point could be left out but I did not find a way where the return type is both Assertion and a Promise. Any even ignoring the Assertion type only results in a warning. An eslint rule with a codefix would be quite helpful
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I found that I had some usages of
to.equalSnapshot
not awaited and that causes some weird behaviors:await has no effect on the type of this expression.
I think this needs two tweaks:
The second point could be left out but I did not find a way where the return type is both
Assertion
and aPromise
. Any even ignoring theAssertion
type only results in a warning. An eslint rule with a codefix would be quite helpfulBeta Was this translation helpful? Give feedback.
All reactions