-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
feat(chai): add containSubset #71972
base: master
Are you sure you want to change the base?
feat(chai): add containSubset #71972
Conversation
@perrin4869 Thank you for submitting this PR! This is a live comment that I will keep updated. 3 packages 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. InactiveThis PR has been inactive for 14 days — please try to get reviewers! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 71972,
"author": "perrin4869",
"headCommitOid": "1a4869b7d2dc1bb98a0f381640218ea34f8e1b91",
"mergeBaseOid": "3f809e880261b4fb4e9003326bdb30897b02a5f8",
"lastPushDate": "2025-02-18T03:02:41.000Z",
"lastActivityDate": "2025-03-05T01:21:15.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "chai-as-promised",
"kind": "edit",
"files": [
{
"path": "types/chai-as-promised/chai-as-promised-tests.ts",
"kind": "test"
},
{
"path": "types/chai-as-promised/index.d.ts",
"kind": "definition"
}
],
"owners": [
"jt000",
"Kuniwak",
"leonard-thieu",
"lazerwalker",
"mattbishop",
"worr"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "chai-subset",
"kind": "edit",
"files": [
{
"path": "types/chai-subset/package.json",
"kind": "package-meta",
"suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-packagejson) and not moving towards it (check: `peerDependencies`)"
}
],
"owners": [
"delta62",
"AGBrown"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "chai",
"kind": "edit",
"files": [
{
"path": "types/chai/chai-tests.ts",
"kind": "test"
},
{
"path": "types/chai/index.d.ts",
"kind": "definition"
},
{
"path": "types/chai/package.json",
"kind": "package-meta-ok"
}
],
"owners": [
"Bartvds",
"AGBrown",
"olivr70",
"mwistrand",
"shaunluttin",
"micksatana",
"ErikSchierboom",
"bparan",
"CXuesong",
"joeykilpatrick"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "stale",
"reviewer": "jakebailey",
"date": "2025-02-25T15:59:24.000Z",
"abbrOid": "f1a3da3"
},
{
"type": "stale",
"reviewer": "andrewbranch",
"date": "2025-02-21T19:01:52.000Z",
"abbrOid": "f1a3da3"
}
],
"mainBotCommentID": 2664500422,
"ciResult": "pass"
} |
🔔 @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop @worr @delta62 @AGBrown @Bartvds @olivr70 @mwistrand @shaunluttin @micksatana @ErikSchierboom @bparan @CXuesong @joeykilpatrick — please review this PR in the next few days. Be sure to explicitly select |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
this change causes a duplicate conflict with |
types/chai-subset/index.d.ts
Outdated
@@ -3,6 +3,7 @@ | |||
declare global { | |||
namespace Chai { | |||
interface Assertion { | |||
// @ts-expect-error 230 this is a duplicate on chai >= 5.2.0 |
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 can’t do this. Instead, you’ll have to pin chai-subset’s @types/chai
dependency version. Maybe it should be changed to a peerDependency... @jakebailey @sandersn any input on this?
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.
A peer dep on @types/chai@<5.2
may work, yeah.
This also points out that this PR needs to be updating chai's version number, since it's currently set to 5.0 but this new thing is in 5.2.
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.
I tried to set @types/chai as a peerDependency, but it seems that that is not allowed
#20290
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.
Peer deps have been allowed since microsoft/DefinitelyTyped-tools#1072. What error did you get?
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.
Please see 629f43f for what I tried. That fails with an error by dtslint
:
> definitely-typed@0.0.3 test /home/perrin4869/nodejs/DefinitelyTyped
> node --enable-source-maps node_modules/@definitelytyped/dtslint/ types "chai-subset"
dtslint@0.1.2
Error:
* chai-subset's package.json should not include property peerDependencies
at runTests (/home/perrin4869/nodejs/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.1.2_typescript@5.4.0-dev.20240109/node_modules/@definitelytyped/dtslint/src/index.ts:134:11)
at async main (/home/perrin4869/nodejs/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.1.2_typescript@5.4.0-dev.20240109/node_modules/@definitelytyped/dtslint/src/index.ts:82:5)
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.
Your local versions of the @definitelytyped
packages are waaaay out of date. I would git clean your repo and reinstall the root at least.
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.
ohhh I didn't notice that! Thanks!
I had to wipe node_modules
for @definitelytyped/dtslint
to upgrade
I also didn't notice that the CI for 629f43f got interrupted
OK, this should work now!
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.
weird, it's failing on something completely unrelated now...
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.
ok somehow it got fixed ^^;;
@perrin4869 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! |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
@jakebailey, @andrewbranch 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? |
This reverts commit 629f43f.
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
@perrin4869 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 that are failing do not end up on the list of PRs for the DT maintainers to review. |
Re-ping @jt000, @Kuniwak, @leonard-thieu, @lazerwalker, @mattbishop, @worr, @delta62, @AGBrown, @Bartvds, @olivr70, @mwistrand, @shaunluttin, @micksatana, @ErikSchierboom, @bparan, @CXuesong, @joeykilpatrick: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
@@ -52,6 +52,7 @@ declare global { | |||
Arguments: PromisedAssertion; | |||
equal: PromisedEqual; | |||
equals: PromisedEqual; | |||
containSubset: PromisedContainSubset; |
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.
How does this work? I don't see this in their repo: https://github.com/search?q=repo%3Achaijs%2Fchai-as-promised%20containSubset&type=code
Please fill in this template.
pnpm test <package to test>
.Select one of these and delete the others:
If changing an existing definition:
chai-subset
and added assert-based negation to containSubset chaijs/chai#1664package.json
.chai
starting with version5.2.0
has shipped withcontainSubset
. This PR adds the function tochai
andchai-as-promised