-
Notifications
You must be signed in to change notification settings - Fork 27
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
chore: update jest #1263
chore: update jest #1263
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/commercetools/merchant-center-application-kit/lr3vco36u |
@@ -7,7 +7,6 @@ declare namespace jest { | |||
toRender(component: React.ComponentType): R; | |||
toHaveState(selector: string, expected: unknown): R; | |||
// The following matchers are part of https://www.npmjs.com/package/jest-dom | |||
toBeInTheDocument: () => R; |
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.
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.
Ah, good to know!
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 into this! Exiting times ahead for jest 🙌
@@ -128,14 +128,13 @@ | |||
"eslint-plugin-prettier": "3.1.2", | |||
"eslint-plugin-react": "7.18.0", | |||
"eslint-plugin-react-hooks": "2.3.0", | |||
"eslint-plugin-testing-library": "1.4.1", | |||
"eslint-plugin-testing-library": "1.5.0", |
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.
I forgot to do it last time, we need to explicitly enable prefer-expect-query-by
now, as it does not come enabled by default anymore: https://github.com/testing-library/eslint-plugin-testing-library/releases/tag/v1.4.1
More on the reasons here: testing-library/eslint-plugin-testing-library#59
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.
FYI: we're replacing that rule with a new one, targeted only for cases when you want to assert that an element is not in the document.
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.
A good to now. Thanks for sharing 76c8b70.
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.
Ah, interesting. Read up on the background now. Makes sense what's in store there :)
@@ -38,6 +38,6 @@ | |||
"@commercetools-frontend/mc-scripts": "15.8.0", | |||
"@testing-library/react": "9.4.0", | |||
"enzyme": "3.11.0", | |||
"jest": "24.9.0" | |||
"jest": "25.1.0" |
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.
Should we consider this a breaking change? Cause the jest peer dep also needs to be bumped.
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 raising. I think to me it's not a breaking change. Only node 6 support is dropped and we require node 10/12 in other cases already. All other breaking changes I see are dependent to how people use jest within our peer dependency range. So if somebody imported from @jest/core
or jest-cli
and that now changed is not something we can make guarantees about. If their remain to have 24 installed nothing would break for them in anyway. Do you agree or have other concerns about this?
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.
Yeah if we support both version it should be fine like this. Let's maybe mention it in the changelog that people can start using jest 25.
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! 👌
Summary
I planned to release today and wanted to update things accordingly.
Description
Jest comes with some nice improvements in performance which I'd hope our MC FE CI chains to be speedier.
https://jestjs.io/blog/2020/01/21/jest-25
However, it also comes with us (here at least) logging some things:
which is a cool idea, should be fine and resolve itself.
Then I also took a shot at updating to jsdom v16 cause we could use it as we require node 12. Jest keeps node 8 support to be nice even though it's EOL.
However, it changes a bit how we can fiddle with the window
so I would do that in another step maybe.
Note that none of jest's breaking changes affect us.