-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Testing arity of functions no longer works #9792
Comments
Also, since this was a breaking change introduced as a minor bump in a transitive dependency on the |
Did you make sure expect was downgraded? It's in semver range /cc @G-Rath, |
@nfantone I'd personally find such an assertion a bit confusing, I'd recommend a |
Yeah that's fair enough - sorry about that. TypeScript knows that functions have (I'm looking forward to having I'll make a PR. |
I know it is - that's why downgrading
I understand where you're coming from. And I agree: having a
Hey, no need to apologise at all! Great work contributing to an awesome project like |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
After the introduction of this commit, testing array-like structures and function arities no longer works with
.toHaveLength
. This used to behave correctly previously.To Reproduce
Pass in a function as the argument to
.toHaveLength
Test will fail with:
Expected behavior
Test should pass. Also the returned error message ("have a length property whose value must be a number") is rather misleading as the argument being passed clearly conforms to that description. This is a breaking change in a minor release.
envinfo
The text was updated successfully, but these errors were encountered: