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] adding definitions for mocked
function
#57776
Conversation
@k-rajat19 Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. 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
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 57776,
"author": "k-rajat19",
"headCommitOid": "280655bdc093a54452e8d07e30193c6a86d17d55",
"lastPushDate": "2021-12-22T06:47:01.000Z",
"lastActivityDate": "2021-12-30T19:30:51.000Z",
"mergeOfferDate": "2021-12-30T18:25:32.000Z",
"mergeRequestDate": "2021-12-30T19:30:51.000Z",
"mergeRequestUser": "k-rajat19",
"hasMergeConflict": false,
"isFirstContribution": true,
"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",
"devanshj",
"pawfa",
"regevbr",
"gerkindev",
"domdomegg"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "orta",
"date": "2021-12-30T19:03:40.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2021-12-30T18:24:55.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "domdomegg",
"date": "2021-12-23T18:25:49.000Z",
"isMaintainer": false
},
{
"type": "approved",
"reviewer": "G-Rath",
"date": "2021-12-22T06:57:11.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 997369120,
"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 @devanshj @pawfa @regevbr @GerkinDev @domdomegg — please review this PR in the next few days. Be sure to explicitly select |
@k-rajat19 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.
We don't need to define the function ourselves, since it's exported by jest-mock
so we can use that which I've done in #57775 - that way we don't have to be maintaining the types ourselves.
@G-Rath as i already worked on it so i am leaving this PR open for review by maintainers of DT . They can close this PR if they want :) |
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh 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.
@k-rajat19 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
I totally agree with what you have said above. I'm still confused that which is the better way of doing it 😅 (by looking at current scene in |
@SimenB should I close this? |
I'm not involved with maintaining |
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.
Have requested a few changes, but overall this looks fine - it does introduce some mixed/duplicate types that we should try and resolve ASAP (e.g. jest-mock
uses MockWithArgs
to type our MockedFunction
) but it should be easier to do that with these shipped as-is because codebases can choose which ones to use which'll make it easier to find where they're not compatible with each other.
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.
Looks good - have left a couple of tidy up comments but they don't need to be actioned for this to be merged 🙂
|
@G-Rath Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh 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.
Thank you @k-rajat19 and @G-Rath for your excellent contributions to this. These changes look good to me now.
As a side note, I'm very impressed by the high quality collaboration between you two, having read through your comments on this and #57775. Keep up the great work! :)
Would love to see this merged! Thanks! |
ping @orta @sandersn @peterblazejewicz @andrewbranch :) |
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!
@k-rajat19: Everything looks good here. I am ready to merge this PR (at 280655b) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@NoHomey, @jwbay, @asvetliakov, @alexjoverm, @epicallan, @ikatyang, @wsmd, @JamieMason, @douglasduteil, @ahnpnl, @UselessPickles, @r3nya, @Hotell, @sebald, @andys8, @antoinebrault, @gstamac, @ExE-Boss, @quassnoi, @Belco90, @tonyhallett, @ycmjason, @devanshj, @pawfa, @regevbr, @GerkinDev, @domdomegg: you can do this too.) |
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.
All additions, and looks like what the linked runtime PR indicates - so looks reasonable to me
Ready to merge |
…d` function by @k-rajat19 * mocked * fixing jest-tests * prettier * removing prettier changes * tslint * making requested changes * jest-tests * removing comments
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition:
#57716 jestjs/jest#12131