-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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] constrain type of the jest.replacedProperty()
argument
#64936
[jest] constrain type of the jest.replacedProperty()
argument
#64936
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 you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. 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": 64936,
"author": "mrazauskas",
"headCommitOid": "2eed5aa3bb89cdb5e96a1f92f5d758f830eb2ef3",
"mergeBaseOid": "498a65e3da2f685fc7b86e99f4094bddf1512459",
"lastPushDate": "2023-04-18T18:38:58.000Z",
"lastActivityDate": "2023-04-19T09:41:05.000Z",
"maintainerBlessed": "Waiting for Code Reviews",
"mergeOfferDate": "2023-04-19T09:40:27.000Z",
"mergeRequestDate": "2023-04-19T09:41:05.000Z",
"mergeRequestUser": "mrazauskas",
"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",
"gerkindev",
"domdomegg",
"mrazauskas"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "domdomegg",
"date": "2023-04-19T09:39:40.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1488891670,
"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 @GerkinDev @domdomegg — please review this PR in the next few days. Be sure to explicitly select |
Re-ping @NoHomey, @jwbay, @asvetliakov, @alexjoverm, @epicallan, @ikatyang, @wsmd, @JamieMason, @douglasduteil, @ahnpnl, @UselessPickles, @r3nya, @Hotell, @sebald, @andys8, @antoinebrault, @gstamac, @ExE-Boss, @quassnoi, @Belco90, @tonyhallett, @ycmjason, @pawfa, @GerkinDev, @domdomegg: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
Co-authored-by: Adam Jones <domdomegg+git@gmail.com>
@domdomegg 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? |
Co-authored-by: Adam Jones <domdomegg+git@gmail.com>
Ready to merge |
Thanks for the PR @mrazauskas 🙌 , and apologies for the delayed review on my part. |
Thanks to everyone who contributed to this! ❤️ |
I have a PR updating from v29.4.0 to v29.5.1 of these types and I'm getting a similar build error as seen here xt0rted/dotnet-sdk-updater#391. Should this PR of fixed that error or is it a new one?
|
The problem is on Jest side. It is fixed already, just not yet released (see jestjs/jest#14097). |
Please fill in this template.
npm test <package to test>
.If changing an existing definition:
jest.replaceProperty()
replace methods jestjs/jest#14008 (comment)Summary
Based on user report (see link above). Currently if compiler option
"skipLibCheck": false
is set and@types/jest
are used with Jest’s built-in types, the compiler gives following error:This is because the
jest.replacedProperty()
argument is missing a constrain in@types/jest
.jest.spyOn()
is similar, so I added the same{}
constrain (note that in Jest built-in types the constrain isobject
):DefinitelyTyped/types/jest/index.d.ts
Line 447 in 498a65e