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
@SimenB there is no type error, as expect() accepts any. The runtime error occur but is not clear enough for "first-time jesters".
No type error.
Error itself is clear, but not working as expected, once that I tried to capture it via .toThrow(), but it is thrown before to catch.
In my opinion, eslint-plugin-jest would do a good job of catching this type of error before the user runs it, as it would be able to predict and fix it. Even a --fix would be feasible by applying a function wrapper.
Given that TypeScript currently won't catch this, it might be worth a lint rule but it would have to use TypeScript to determine the type of whatever's been given to expect.
When is possible to determine if the expect(value) is not a function when used with .toThrow(), it must be an error.
The text was updated successfully, but these errors were encountered: