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

fix(@jest/types): align jest v28 dependencies (requires typescript bump to v4.5) #60832

Merged
merged 8 commits into from Jun 17, 2022

Conversation

viceice
Copy link
Contributor

@viceice viceice commented Jun 16, 2022

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should contain { "extends": "@definitelytyped/dtslint/dt.json" }, and no additional rules.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@viceice viceice changed the title chore: use jest v28 dependnecies in @jest/types chore: use jest v28 dependencies in @jest/types Jun 16, 2022
@typescript-bot
Copy link
Contributor

typescript-bot commented Jun 16, 2022

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

15 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 which affect more than one package

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": 60832,
  "author": "viceice",
  "headCommitOid": "2efa3c17364f9406e7a9df910c6e1d63107f1e53",
  "mergeBaseOid": "9c58088a931fdab5737f2e1343f3946421bf0de8",
  "lastPushDate": "2022-06-16T14:02:32.000Z",
  "lastActivityDate": "2022-06-17T11:46:34.000Z",
  "mergeOfferDate": "2022-06-17T11:33:58.000Z",
  "mergeRequestDate": "2022-06-17T11:46:34.000Z",
  "mergeRequestUser": "viceice",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "expect-puppeteer",
      "kind": "edit",
      "files": [
        {
          "path": "types/expect-puppeteer/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "tkrotoff",
        "jfm710"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "heft-jest",
      "kind": "edit",
      "files": [
        {
          "path": "types/heft-jest/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "octogonz",
        "iclanton"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-axe",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-axe/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "erbridge"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "jest-expect-message",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-expect-message/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "mike-d-davydov",
        "saitonakamura"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-image-snapshot",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-image-snapshot/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "dawnmist",
        "erbridge",
        "peterblazejewicz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "jest-in-case",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-in-case/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "geovanisouza92"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-json-schema",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-json-schema/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "lvl99"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-matcher-one-of",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-matcher-one-of/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "joemitchard"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-plugin-context",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-plugin-context/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "jonasheinrich"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-sinon",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-sinon/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "seidelmartin"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "jest-specific-snapshot",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-specific-snapshot/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "dawnmist"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "jest-when",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest-when/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "aldentaylor",
        "immanuel192",
        "gstamac",
        "hipsterbrown"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "jest",
      "kind": "edit",
      "files": [
        {
          "path": "types/jest/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jest/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "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",
        "regevbr",
        "gerkindev",
        "domdomegg"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "mapbox__aws-sdk-jest",
      "kind": "edit",
      "files": [
        {
          "path": "types/mapbox__aws-sdk-jest/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "stevensnoeijen"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "testing-library__jest-dom",
      "kind": "edit",
      "files": [
        {
          "path": "types/testing-library__jest-dom/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "gnapse",
        "jgoz",
        "smacpherson64",
        "AndrewLeedham"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "peterblazejewicz",
      "date": "2022-06-17T11:32:58.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "SimenB",
      "date": "2022-06-17T11:10:26.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1157422591,
  "ciResult": "pass"
}

@viceice
Copy link
Contributor Author

viceice commented Jun 16, 2022

This is a follow-up from #58784. If you upgrade all jest packages to v28, typescript will complain because of importing wrong jest types

@viceice
Copy link
Contributor Author

viceice commented Jun 16, 2022

@SimenB WDYT?

@viceice
Copy link
Contributor Author

viceice commented Jun 16, 2022

[11:02:17 AM] Starting compilation in watch mode...

test/util.ts:141:32 - error TS2345: Argument of type 'Plugin' is not assignable to parameter of type 'Plugin_2'.
  Type 'NewPlugin' is not assignable to type 'Plugin_2'.
    Type 'import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").NewPlugin' is not assignable to type 'import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").NewPlugin'.
      Types of property 'serialize' are incompatible.
        Type '(val: any, config: import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Config, indentation: string, depth: number, refs: import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Refs, printer: import("/home/kriese/src/renovate...' is not assignable to type '(val: any, config: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Config, indentation: string, depth: number, refs: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Refs, printer: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Printer)...'.
          Types of parameters 'config' and 'config' are incompatible.
            Type 'import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Config' is not assignable to type 'import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Config'.
              Types of property 'plugins' are incompatible.
                Type 'import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Plugins' is not assignable to type 'import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Plugins'.
                  Type 'Plugin_2' is not assignable to type 'Plugin'.
                    Type 'NewPlugin' is not assignable to type 'Plugin'.
                      Type 'import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").NewPlugin' is not assignable to type 'import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").NewPlugin'.
                        Types of property 'serialize' are incompatible.
                          Type '(val: any, config: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Config, indentation: string, depth: number, refs: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Refs, printer: import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Printer)...' is not assignable to type '(val: any, config: import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Config, indentation: string, depth: number, refs: import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Refs, printer: import("/home/kriese/src/renovate...'.
                            Types of parameters 'config' and 'config' are incompatible.
                              Property 'maxWidth' is missing in type 'import("/home/kriese/src/renovate/node_modules/@types/jest/node_modules/pretty-format/build/types").Config' but required in type 'import("/home/kriese/src/renovate/node_modules/pretty-format/build/index").Config'.

141   expect.addSnapshotSerializer(replacingSerializer(from, to));
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/pretty-format/build/index.d.ts:44:3
    44   maxWidth: number;
         ~~~~~~~~
    'maxWidth' is declared here.

test/util.ts:157:32 - error TS2345: Argument of type 'Plugin' is not assignable to parameter of type 'Plugin_2'.

157   expect.addSnapshotSerializer(bufferSerializer);
                                   ~~~~~~~~~~~~~~~~

[11:02:34 AM] Found 2 errors. Watching for file changes.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Jun 16, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Jun 16, 2022
@typescript-bot
Copy link
Contributor

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

@typescript-bot typescript-bot added Untested Change This PR does not touch tests and removed The CI failed When GH Actions fails labels Jun 16, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Jun 16, 2022
@typescript-bot
Copy link
Contributor

Hey @viceice,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Jun 16, 2022
@typescript-bot
Copy link
Contributor

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

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Jun 16, 2022
`@sinclair/typebox` needs this
@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Jun 16, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Jun 16, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Jun 16, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Jun 16, 2022
@typescript-bot
Copy link
Contributor

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

@typescript-bot typescript-bot added Edits multiple packages and removed The CI failed When GH Actions fails labels Jun 16, 2022
types/expect-puppeteer/index.d.ts Outdated Show resolved Hide resolved
types/heft-jest/index.d.ts Outdated Show resolved Hide resolved
types/jest-axe/index.d.ts Outdated Show resolved Hide resolved
types/jest-expect-message/index.d.ts Outdated Show resolved Hide resolved
types/jest-image-snapshot/index.d.ts Outdated Show resolved Hide resolved
types/jest-specific-snapshot/index.d.ts Outdated Show resolved Hide resolved
types/jest-when/index.d.ts Outdated Show resolved Hide resolved
types/jest/index.d.ts Outdated Show resolved Hide resolved
types/mapbox__aws-sdk-jest/index.d.ts Outdated Show resolved Hide resolved
types/testing-library__jest-dom/index.d.ts Outdated Show resolved Hide resolved
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board Jun 16, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Jun 16, 2022
@typescript-bot
Copy link
Contributor

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

@peterblazejewicz
Copy link
Member

@viceice can you edit the PR title, so it reflects TS version bump to be aligned with Jest v28 TS version? Thanks!

@viceice viceice changed the title chore: use jest v28 dependencies in @jest/types fix(@jest/types): align jest v28 dependencies (requires typescript v4.5 bump) Jun 16, 2022
@viceice viceice changed the title fix(@jest/types): align jest v28 dependencies (requires typescript v4.5 bump) fix(@jest/types): align jest v28 dependencies (requires typescript bump to v4.5) Jun 16, 2022
types/expect-puppeteer/index.d.ts Outdated Show resolved Hide resolved
types/heft-jest/index.d.ts Outdated Show resolved Hide resolved
types/jest-axe/index.d.ts Outdated Show resolved Hide resolved
types/jest-expect-message/index.d.ts Outdated Show resolved Hide resolved
types/jest-image-snapshot/index.d.ts Outdated Show resolved Hide resolved
types/jest-specific-snapshot/index.d.ts Outdated Show resolved Hide resolved
types/jest-when/index.d.ts Outdated Show resolved Hide resolved
types/jest/index.d.ts Outdated Show resolved Hide resolved
types/mapbox__aws-sdk-jest/index.d.ts Show resolved Hide resolved
types/testing-library__jest-dom/index.d.ts Outdated Show resolved Hide resolved
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board Jun 16, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Jun 16, 2022
@typescript-bot
Copy link
Contributor

@peterblazejewicz, @SimenB 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 Other Approved This PR was reviewed and signed-off by a community member. label Jun 17, 2022
@typescript-bot
Copy link
Contributor

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

Copy link
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

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

LGTM!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jun 17, 2022
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in New Pull Request Status Board Jun 17, 2022
@typescript-bot
Copy link
Contributor

@viceice: Everything looks good here. I am ready to merge this PR (at 2efa3c1) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

@viceice
Copy link
Contributor Author

viceice commented Jun 17, 2022

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Jun 17, 2022
@typescript-bot typescript-bot merged commit e7c664f into DefinitelyTyped:master Jun 17, 2022
@viceice viceice deleted the patch-1 branch June 17, 2022 11:48
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Jun 25, 2022
@SimenB SimenB mentioned this pull request Jul 3, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Edits multiple packages Maintainer Approved Other Approved This PR was reviewed and signed-off by a community member. Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants