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] type done callback on each #63882
Conversation
@staff0rd 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
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": 63882,
"author": "staff0rd",
"headCommitOid": "8fa31a2aa6603a68dd6dfbff5a5fe6a0d4a6e6f8",
"mergeBaseOid": "0e64955901599be1e43a2e50c556d141a2b8fdd8",
"lastPushDate": "2023-02-22T11:15:37.000Z",
"lastActivityDate": "2023-03-15T05:12:36.000Z",
"mergeOfferDate": "2023-03-13T20:00:55.000Z",
"mergeRequestDate": "2023-03-15T05:12:36.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": "jakebailey",
"date": "2023-03-13T20:00:07.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "mrazauskas",
"date": "2023-03-13T17:57:46.000Z",
"isMaintainer": false
},
{
"type": "approved",
"reviewer": "domdomegg",
"date": "2023-03-05T18:15:35.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1378750382,
"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 @mrazauskas — please review this PR in the next few days. Be sure to explicitly select |
Hm.. I just tried to implement this in Jest’s building typings and found out that following case current works, but fails after this change is made: test.each([
[
{ supportsDynamicImport: true, supportsStaticESM: true },
{ supportsDynamicImport: true, supportsStaticESM: true },
],
[{ supportsDynamicImport: true }, { supportsDynamicImport: true, supportsStaticESM: false }],
])('%j -> %j', (input, output) => {
console.log(input);
console.log(output);
}); This and few more type errors surfaced in Jest repo. See CI failures in jestjs/jest#13756 |
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.
Posting this 'request changes' review just to draw attention to the problem mentioned above. Jest repo does not use @types/jest
, but this PR has the same issue which surfaced in the above mentioned PR. For example:
test.each([
['Boolean', {automock: []}],
['Array', {coverageReporters: {}}],
['String', {preset: 1337}],
['Object', {haste: 42}],
// requires to add this type cast, if change from this PR is implemented
// currently type check is passing without the cast
] as Array<[string, Record<string, unknown>]>)(
'pretty prints valid config for %s',
(_type, config) => {
expect(() =>
validate(config, {
exampleConfig: validConfig,
}),
).toThrowErrorMatchingSnapshot();
},
);
@staff0rd 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! |
@staff0rd Partial support for Perhaps this PR could take similar path for now? |
@staff0rd I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Feb 25th (in a week) if the issues aren't addressed. |
@mrazauskas, @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? |
@mrazauskas i added the test case you found to be breaking and reduced the typing to not cater for the array-of-arrays syntax |
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.
Thanks!
@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? |
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: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
It has been more than two weeks and this PR still has no reviews. I'll bump it to the DT maintainer queue. Thank you for your patience, @staff0rd. (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.) |
Ready to merge |
Thanks again. I just wanted to see this merged finally. |
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition:
Note
I also added a test case for
ReadonlyArray
declaration, however I was unable to fix it for the done callback as the variadic tuple approach doesn't appear to work there, ie: