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
Ensure expect(function).toThrow() #1329
Comments
You get a runtime error (and possibly a type error?) for this already. Not sure if a lint rule is needed? |
@SimenB there is no type error, as
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 |
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 |
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: