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

[typescript] Add T param to Matchers interface #1620

Merged
merged 2 commits into from Nov 12, 2019
Merged

[typescript] Add T param to Matchers interface #1620

merged 2 commits into from Nov 12, 2019

Conversation

spudly
Copy link
Contributor

@spudly spudly commented Nov 8, 2019

This fixes typescript type definitions when using jest-emotion with jest 24.

I simply added a parameter to the Matchers interface in the typescript types file for jest-emotion.

In Jest 24 they added a second generic parameter to the Matchers interface. Typescript requires interfaces to have the same parameters, so jest-emotion needs to add it also.

See DefinitelyTyped/DefinitelyTyped#39982

Checklist:

  • [N/A] Documentation
  • [N/A] Tests
  • Code complete
  • Changeset

@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2019

🦋 Changeset is good to go

Latest commit: b753cbf

We got this.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist
Copy link
Member

Andarist commented Nov 8, 2019

@spudly if this is a requirement (to parameter count to match) - isn't this a breaking change (sort of) for people using older version of jest (or its typings)?

@spudly
Copy link
Contributor Author

spudly commented Nov 8, 2019 via email

@Andarist
Copy link
Member

Andarist commented Nov 9, 2019

You can target next branch with this PR instead - adjust the changeset to be of type major + upgrade @types/jest deps.

@Andarist Andarist added this to the v11 milestone Nov 9, 2019
@JakeGinnivan
Copy link
Contributor

Does the dependency on "@types/jest" need to be bumped too?

@Andarist
Copy link
Member

Yes, that would require updating as well.

@spudly will you have time to address the code review comments?

@spudly spudly changed the base branch from master to next November 11, 2019 13:40
@spudly
Copy link
Contributor Author

spudly commented Nov 11, 2019

Made the requested changes. Ready for review again.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 11, 2019

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b753cbf:

Sandbox Source
Emotion Configuration

@spudly
Copy link
Contributor Author

spudly commented Nov 11, 2019

sorry, had conflicts. resolved.

Fixes type definition issue when using jest-emotion with jestv24

See DefinitelyTyped/DefinitelyTyped#39982
@Andarist
Copy link
Member

Thanks for this! I should merge this soon.

As a point of reference for anyone interested in this - @types/jest got this second param just very recently (17 days ago) in v24.0.20. https://www.npmjs.com/package/@types/jest/v/24.0.20

cc @JakeGinnivan just as a confirmation - such change is OK as we should get ourselves up-to-date and there is no way to support both, right? I've tried searching if this can somehow be overloaded to match both, but couldn't find a way.

Co-Authored-By: Mateusz Burzyński <mateuszburzynski@gmail.com>
@Andarist Andarist merged commit 702f3fd into emotion-js:next Nov 12, 2019
@github-actions github-actions bot mentioned this pull request Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants