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] revert spyOn overload breaking change #63196

Closed
wants to merge 1 commit into from

Conversation

dlech
Copy link
Contributor

@dlech dlech commented Nov 10, 2022

PR #6278 introduced a breaking change to the jest types for spyOn by changing the overload ordering. This undoes that change.

An example that was affected by the breaking change is added to the tests.

Reverting the ordering broke one of the tests that was added in #6278. However, that test was ambiguous because Date is function in addition to a class. Replacing it with a class that requires the new keyword like Error passes the test.

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

PR DefinitelyTyped#6278 introduced a breaking change to the jest types for spyOn by
changing the overload ordering. This undoes that change.

An example that was affected by the breaking change is added to the
tests.

Reverting the ordering broke one of the tests that was added in DefinitelyTyped#6278.
However, that test was ambiguous because `Date` is function in addition
to a class. Replacing it with a class that requires the `new` keyword
like `Error` passes the test.
@dlech dlech mentioned this pull request Nov 10, 2022
7 tasks
@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 10, 2022

@dlech 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 are still running
  • 🕐 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": 63196,
  "author": "dlech",
  "headCommitOid": "387840120dfe0f3fb278c1322a003b547941b077",
  "mergeBaseOid": "c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c",
  "lastPushDate": "2022-11-10T17:49:40.000Z",
  "lastActivityDate": "2022-11-10T17:50:30.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",
        "pawfa",
        "gerkindev",
        "domdomegg",
        "mrazauskas"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1310669016,
  "ciResult": "unknown"
}

@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 @pawfa @GerkinDev @domdomegg @mrazauskas — 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 Nov 10, 2022
@dlech
Copy link
Contributor Author

dlech commented Nov 10, 2022

Also solved by #63182.

@dlech dlech closed this Nov 10, 2022
@typescript-bot typescript-bot removed this from Waiting for Code Reviews in New Pull Request Status Board Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants