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

[jest-28] fix types of jest.useFakeTimers() #60054

Closed
wants to merge 2 commits into from
Closed

[jest-28] fix types of jest.useFakeTimers() #60054

wants to merge 2 commits into from

Conversation

mrazauskas
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: PR which introduced the change
  • 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.

Jest 28 just shipped with lots of new features and breaking changes. I am trying to figure it out how to reflect those here.

For instance, jest.useFakeTimers() takes an options bag now. I copied types and tests from Jest repo. Would be nice to avoid coping in the future, but perhaps for now this is fine.

Another question. This and few others are breaking changes. It does not sound good to bump major version with each PR. Would it work releasing alphas first?

@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 26, 2022

@mrazauskas Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package 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 failed
  • 🕐 Most recent commit is approved by a DT maintainer

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


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 60054,
  "author": "mrazauskas",
  "headCommitOid": "0488deafc333e46489e7af1ff760083eab3a497b",
  "mergeBaseOid": "65d953cfe06db5c867630bccb1ad2eadff3fd570",
  "lastPushDate": "2022-04-26T08:17:32.000Z",
  "lastActivityDate": "2022-04-26T08:17:32.000Z",
  "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",
        "devanshj",
        "pawfa",
        "regevbr",
        "gerkindev",
        "domdomegg"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1109484240,
  "ciResult": "fail",
  "ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/0488deafc333e46489e7af1ff760083eab3a497b/checks?check_suite_id=6261183408"
}

@typescript-bot
Copy link
Contributor

🔔 @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @UselessPickles @r3nya @Hotell @sebald @andys8 @antoinebrault @gstamac @ExE-Boss @quassnoi @Belco90 @tonyhallett @ycmjason @devanshj @pawfa @regevbr @GerkinDev @domdomegg — 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 this to Waiting for Code Reviews in New Pull Request Status Board Apr 26, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 26, 2022
@typescript-bot
Copy link
Contributor

@mrazauskas 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 Apr 26, 2022
@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Apr 26, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 26, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 26, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 26, 2022
@typescript-bot
Copy link
Contributor

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

@mrazauskas
Copy link
Contributor Author

The whole test suite fails on TypeScript@4.7 and that does not seem to be related with my changes. Seems like TS 4.7 is still in beta. Probably there is a reason to test types on beta releases of TS, but I don’t know how to make the CI pass in this case. Strange requirements.

@mrazauskas mrazauskas closed this Apr 26, 2022
@typescript-bot typescript-bot removed this from Needs Author Action in New Pull Request Status Board Apr 26, 2022
@bratanon
Copy link

Why was this closed?

@mrazauskas
Copy link
Contributor Author

mrazauskas commented May 12, 2022

Too many things were failing in CI:

Screenshot 2022-05-12 at 19 01 15

Note the number of lines. Most of errors were like these ones. Hardly related with this change. Just felt too much to wrestle. So I gave up. Feel free to use the code in new PR.

(Or maybe I broke it somehow. In any case, the decision was to give up and to leave this for someone smarter. I prefer to import Jest types from @jest/globals in my projects.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants