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: add Date to setSystemTime param types #45685

Conversation

liamfd
Copy link
Contributor

@liamfd liamfd commented Jun 24, 2020

Following up on #45496, this PR adds support for Date arguments to jest.setSystemTime now that jestjs/jest#10169 is merged and released.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

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:
  • 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.
    • (This currently says 16.0, so it's pretty far out of date, but I can make the change if that's desirable)
  • Include tests for your changes
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR Critical package labels Jun 24, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Jun 24, 2020

@liamfd Thank you for submitting this PR!

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ❌ Most recent commit is approved by DT maintainers

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": 45685,
  "author": "liamfd",
  "owners": [
    "NoHomey",
    "jwbay",
    "asvetliakov",
    "alexjoverm",
    "epicallan",
    "ikatyang",
    "wsmd",
    "JamieMason",
    "douglasduteil",
    "ahnpnl",
    "joshuakgoldberg",
    "UselessPickles",
    "r3nya",
    "hotell",
    "sebald",
    "andys8",
    "antoinebrault",
    "gstamac",
    "ExE-Boss",
    "quassnoi",
    "Belco90",
    "tonyhallett",
    "ycmjason",
    "devanshj",
    "pawfa",
    "regevbr",
    "mskelton"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "2023b2a",
  "headCommitOid": "2023b2a00aa16f43d7d7f6cd44a33ae47a034cd1",
  "mergeIsRequested": false,
  "stalenessInDays": 0,
  "lastCommitDate": "2020-06-24T12:37:41.000Z",
  "lastCommentDate": "2020-06-24T12:37:41.000Z",
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/45685/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Critical",
  "anyPackageIsNew": false,
  "packages": [
    "jest"
  ],
  "files": [
    {
      "filePath": "types/jest/index.d.ts",
      "kind": "definition",
      "package": "jest"
    },
    {
      "filePath": "types/jest/jest-tests.ts",
      "kind": "test",
      "package": "jest"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-06-24T15:20:25.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @JoshuaKGoldberg @UselessPickles @r3nya @Hotell @sebald @andys8 @antoinebrault @gstamac @ExE-Boss @quassnoi @Belco90 @tonyhallett @ycmjason @devanshj @pawfa @regevbr @mskelton - 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 removed the Where is GH Actions? GH Actions didn't give a response to this PR label Jun 24, 2020
@typescript-bot typescript-bot moved this from Other to Needs Maintainer Review in New Pull Request Status Board Jun 24, 2020
@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #45685 diff
Batch compilation
Memory usage (MiB) 81.2 83.2 +2.4%
Type count 14712 14712 0%
Assignability cache size 4813 4814 0%
Language service
Samples taken 2575 2578 0%
Identifiers in tests 2575 2578 0%
getCompletionsAtPosition
    Mean duration (ms) 373.3 370.8 -0.7%
    Mean CV 7.9% 8.0%
    Worst duration (ms) 497.9 536.0 +7.7%
    Worst identifier calls afterEach
getQuickInfoAtPosition
    Mean duration (ms) 374.2 372.3 -0.5%
    Mean CV 8.6% 8.5% -1.3%
    Worst duration (ms) 503.2 488.9 -2.8%
    Worst identifier each mockResolvedValueOnce

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jun 24, 2020
Copy link
Contributor

@mskelton mskelton left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Jun 24, 2020
@elibarzilay elibarzilay merged commit 15fe069 into DefinitelyTyped:master Jun 24, 2020
@typescript-bot typescript-bot removed this from Needs Maintainer Review in New Pull Request Status Board Jun 24, 2020
@elibarzilay
Copy link
Contributor

@liamfd: I now remember that there was some talk about holding off this change, was it supposed to be merged?

@typescript-bot
Copy link
Contributor

I just published @types/jest@26.0.3 to npm.

@liamfd
Copy link
Contributor Author

liamfd commented Jun 26, 2020

@elibarzilay Hey, sorry, just seeing this.

We pulled it out of #45496 (see #45496 (comment)) because at that time jestjs/jest#10169 hadn't been merged and released, but it has been now, so it seemed safe to add this.

That said, I see that this got released as 26.03, but jest is now at 26.1.0. I think I should have bumped the version number in types/jest/index.d.ts (when I made the PR I thought it was at 16.0, but I now realize that I was looking at types/jest/v16/index.d.ts.) Note that technically, these types are also valid for users of jest 26.0, they will produce code that runs without issue, they just didn't match jest's internal types.

I'm happy to submit a PR to bump the version number in the header if that's beneficial. Sorry, I'm new to contributing to this repo.

@ExE-Boss
Copy link
Contributor

I think the version bump should be done as part of #45603.

ngbrown pushed a commit to ngbrown-forks/DefinitelyTyped that referenced this pull request Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants