-
-
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
Fix lifecycle hook function types #10480
Conversation
Ideally this'd include type tests (based on #10407), but we don't have any tests for these globals, so possibly out of scope? |
Added a new test file for the globals. The test successfully fails™ before the suggested changes, but is now passing. It doesn't test exactly what I wanted (I wanted to test the argument types, it's testing the function return types), but it does the job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks! Could you update the changelog as well?
Wasn't sure where to put it, left it on the |
Exactly right 👍 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #10066
Test plan
Added a new type test suite for the @jest/globals to ensure lifecycle hooks are not typed as
HookFn
that could returnPromise
, but are at least functions that returnvoid
.