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

chore: update jest #1263

Merged
merged 8 commits into from
Jan 22, 2020
Merged

chore: update jest #1263

merged 8 commits into from
Jan 22, 2020

Conversation

tdeekens
Copy link
Contributor

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:

CleanShot 2020-01-22 at 18 23 01@2x

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.

CleanShot 2020-01-22 at 18 21 37@2x

However, it changes a bit how we can fiddle with the window

CleanShot 2020-01-22 at 18 20 45@2x

so I would do that in another step maybe.

Note that none of jest's breaking changes affect us.

CleanShot 2020-01-22 at 17 41 51@2x

@vercel
Copy link

vercel bot commented Jan 22, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/commercetools/merchant-center-application-kit/lr3vco36u
✅ Preview: https://merchant-center-application-kit-git-chore-update-jest.commercetools.now.sh

@@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now comes for free as far as I can tell.

CleanShot 2020-01-22 at 18 17 39@2x

Copy link
Member

Choose a reason for hiding this comment

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

Ah, good to know!

@vercel vercel bot temporarily deployed to Preview January 22, 2020 17:30 Inactive
Copy link
Member

@emmenko emmenko left a 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",
Copy link
Member

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

Copy link
Member

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.

testing-library/eslint-plugin-testing-library#65

Copy link
Contributor Author

@tdeekens tdeekens Jan 22, 2020

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.

Copy link
Contributor Author

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"
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

@vercel vercel bot temporarily deployed to Preview January 22, 2020 19:08 Inactive
@vercel vercel bot temporarily deployed to Preview January 22, 2020 19:12 Inactive
Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

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

Thanks! 👌

@tdeekens tdeekens added the 🤖 Type: Dependencies Dependency updates or something similar label Jan 22, 2020
@tdeekens tdeekens merged commit ceb922b into master Jan 22, 2020
@tdeekens tdeekens deleted the chore/update-jest branch January 22, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 Type: Dependencies Dependency updates or something similar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants