[Bug]: Types no longer allow passing a named function to describe
See original GitHub issueVersion
27.0.6 and 28.0.0-alpha.4
Steps to reproduce
Expected behavior
No type errors on describe(myFunction, () => {})
Actual behavior
Argument of type '() => void' is not assignable to parameter of type 'string'.
Additional context
Allowing taking in class/function names in describe
was added in #5154 and typed in @types/jest
in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/23102.
Tests still pass while taking in a name; it’s just the typings that are incorrect.
Environment
System:
OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Binaries:
Node: 16.13.0 - /usr/bin/node
Yarn: 3.2.0 - /usr/local/bin/yarn
npm: 8.1.0 - /usr/bin/npm
npmPackages:
jest: workspace:* => 28.0.0-alpha.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[Bug]: Types no longer allow passing a named function to ...
[Bug]: Types no longer allow passing a named function to describe · Summary · Jobs. Questions · Bug reports without reproductions · Run...
Read more >Bug Patterns - Error Prone
The called constructor accepts a parameter with the same name and type as one of its caller's parameters, but its caller doesn't pass...
Read more >Bug descriptions — spotbugs 4.7.3 documentation
This document lists the standard bug patterns reported by SpotBugs. ... Class implements Cloneable but does not define or use the clone method....
Read more >Bug Descriptions - fb-contrib
This method passes an array as the key to a Map, element in a Set, or item in a List when the contains...
Read more >javascript - How to define type for a function callback (as any ...
The Function type accepts any function-like value. It provides no type safety when calling the function, which can be a common source of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/facebook/jest/releases/tag/v28.0.0-alpha.5
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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.