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
[jest] Fix options type of jest.mocked()
helper method
#62259
[jest] Fix options type of jest.mocked()
helper method
#62259
Conversation
@mrazauskas Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 62259,
"author": "mrazauskas",
"headCommitOid": "784a9457299e4e87742711877f0ba60a4cd874b6",
"mergeBaseOid": "ed7808e5c43d43ec53ae641cdd4bff6e14d0038e",
"lastPushDate": "2022-09-14T18:43:19.000Z",
"lastActivityDate": "2022-09-15T03:50:42.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "jest",
"kind": "edit",
"files": [
{
"path": "types/jest/index.d.ts",
"kind": "definition"
},
{
"path": "types/jest/jest-tests.ts",
"kind": "test"
}
],
"owners": [
"NoHomey",
"jwbay",
"asvetliakov",
"alexjoverm",
"epicallan",
"ikatyang",
"wsmd",
"JamieMason",
"douglasduteil",
"ahnpnl",
"UselessPickles",
"r3nya",
"hotell",
"sebald",
"andys8",
"antoinebrault",
"gstamac",
"ExE-Boss",
"quassnoi",
"Belco90",
"tonyhallett",
"ycmjason",
"pawfa",
"regevbr",
"gerkindev",
"domdomegg"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "r3nya",
"date": "2022-09-15T03:50:42.000Z",
"isMaintainer": false
},
{
"type": "approved",
"reviewer": "domdomegg",
"date": "2022-09-15T00:52:00.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1247157495,
"ciResult": "pass"
} |
🔔 @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @UselessPickles @r3nya @Hotell @sebald @andys8 @antoinebrault @gstamac @ExE-Boss @quassnoi @Belco90 @tonyhallett @ycmjason @pawfa @regevbr @GerkinDev @domdomegg — please review this PR in the next few days. Be sure to explicitly select |
@mrazauskas The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
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.
LGTM, thanks 🙌
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition:
Summary
Jest 29 shipped with reworked implementation
jest.mocked()
helper method. The second argument is now a bag of options instead of a boolean. The API is documented and I think it makes sense to keep the implementation in@types/jest
aligned. First, users can follow the documentation of Jest. Second, currently this is one of the reasons of the error described in jestjs/jest#13199.Probably it is also a good idea to align the types in order to prevent similar issues in the future.