-
-
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
[Bug]: Types no longer allow passing a named function to describe #12483
Comments
Ah, good catch! /cc @mrazauskas |
Hm.. I was going through the discussion in the PR which added this feature. The maintainers seemed to be skeptical and the only convincing argument was legacy browsers #5154 (comment). Is this still an issue? IE is gone. I have a feeling it might be equally good idea to deprecate this feature. Time comes and older Node version is not supported, the same about browsers. Instead one can easily have |
I don't really see a reason to remove the feature - it's a nice shorthand, and runtime support is already present, it's only the types that don't recognize it |
FWIW I agree with SimenB and think being able to to |
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. |
Version
27.0.6 and 28.0.0-alpha.4
Steps to reproduce
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgEwKYGcDGVgCNVwC+cAZlBCHAOQACAVhjAPQDmANhLgIZvpUDcAKEEkArgDtMMYBHFwQATwBiEqTLkAKAJSJCQwWiw58GxSsnTZAGjja4AXgB8urfyA
Expected behavior
No type errors on
describe(myFunction, () => {})
Actual behavior
Additional context
Allowing taking in class/function names in
describe
was added in #5154 and typed in@types/jest
in DefinitelyTyped/DefinitelyTyped#23102.Tests still pass while taking in a name; it's just the typings that are incorrect.
Environment
The text was updated successfully, but these errors were encountered: