-
Notifications
You must be signed in to change notification settings - Fork 222
[several packages] Update jest matcher types #1239
Conversation
@lemonmade this change makes sense to me. Could you help with Jason's question about what type of version bump this should be in the packages that it touches, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, unfortunately no way to make this a non-breaking change. Since this came as a minor version change on the Jest types, I think I'd do a minor release here and clearly document what Jest type versions coordinate to what package versions in the relevant changelogs.
594d0ba
to
e32e761
Compare
@@ -7,7 +7,7 @@ import { | |||
declare global { | |||
// eslint-disable-next-line @typescript-eslint/no-namespace | |||
namespace jest { | |||
interface Matchers<R> { | |||
interface Matchers<R, T = {}> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80fb3d4
to
a094839
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ thanks for looking at this
Yep your PR fixed React testing, which this originally included as well. This updates the other packages. (I created this PR in January, but took forever to merge it 😅) . Also Victor just commited new changes for another type change in Jest 25 (that's why react-testing is also updated here). I did forget to update the description though, which I've done now (sorry) |
My point is |
Good point, it wasn't optional when I first put the PR up, but it appears that's the changes in jest 25 that Victor added. It shouldn't cause any issues though either in that case? Maybe @vsumner can speak more to those changes as he was the one having issues this time. |
Description
This PR updates the jest matcher types to be compatible with types in jest 25.
This was updated from the original because it doesn't reflect the merged state.
Original Description:
When working on https://github.com/Shopify/web/pull/22447, I ran into issues when using
toHaveReactProps
. For some reason it was no longer inferring the typescript types of the React Components. I believe it was due to this change and due to the namespace no longer implementing the same interface it cause these issues.This PR updates the
@types/jest
package and theMatcher
interface in all packages to match.Type of change
I'm not sure what type of change this should be. It's a breaking change for Typescript projects, but the update to the types package is the real reason, not these packages themselves
ast-utilities
Minor:jest.Matchers
type updated to match@types/jest
version25
graphql-testing
Minor:jest.Matchers
type updated to match@types/jest
version25
react-i18n
Minor:jest.Matchers
type updated to match@types/jest
version25
react-testing
Minor:jest.Matchers
type updated to match@types/jest
version25
Checklist