Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

perrin4869
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

chai starting with version 5.2.0 has shipped with containSubset. This PR adds the function to chai and chai-as-promised

@perrin4869 perrin4869 requested a review from Bartvds as a code owner February 18, 2025 03:02
@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 18, 2025

@perrin4869 Thank you for submitting this PR!

This is a live comment that I will keep updated.

3 packages in this PR

Code Reviews

Because 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes that affect more than one package

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This 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"
}

@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 18, 2025

🔔 @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 Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Feb 18, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Feb 18, 2025
@perrin4869
Copy link
Contributor Author

this change causes a duplicate conflict with chai-subset so I added a comment

@@ -3,6 +3,7 @@
declare global {
namespace Chai {
interface Assertion {
// @ts-expect-error 230 this is a duplicate on chai >= 5.2.0
Copy link
Member

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?

Copy link
Member

@jakebailey jakebailey Feb 21, 2025

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.

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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)

Copy link
Member

@jakebailey jakebailey Feb 25, 2025

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.

Copy link
Contributor Author

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!

Copy link
Contributor Author

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...

Copy link
Contributor Author

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 ^^;;

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Feb 21, 2025
@typescript-bot
Copy link
Contributor

@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!

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed Revision needed This PR needs code changes before it can be merged. labels Feb 23, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Feb 23, 2025
@typescript-bot
Copy link
Contributor

@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?

@typescript-bot typescript-bot added the Check Config Changes a module config files label Feb 25, 2025
This reverts commit 629f43f.
@typescript-bot typescript-bot removed the Check Config Changes a module config files label Feb 25, 2025
@typescript-bot typescript-bot added Check Config Changes a module config files The CI failed When GH Actions fails labels Feb 25, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Feb 25, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Feb 26, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails Check Config Changes a module config files labels Feb 26, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added Check Config Changes a module config files The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Feb 26, 2025
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. and removed The CI failed When GH Actions fails labels Mar 4, 2025
@typescript-bot
Copy link
Contributor

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Check Config Changes a module config files Critical package Edits multiple packages Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer.
Projects
Status: Needs Maintainer Review
Development

Successfully merging this pull request may close these issues.

4 participants