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: bump jest to version 29 #12662

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jean-smaug
Copy link

@jean-smaug jean-smaug commented Aug 13, 2022

Close #12444

@jean-smaug jean-smaug changed the title chore: bump jest to version 28 [WIP]chore: bump jest to version 28 Aug 13, 2022
Comment on lines 15 to 19
process() {
return 'module.exports = {};';
return {
code: 'module.exports = {};',
};
},
Copy link
Author

Choose a reason for hiding this comment

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

Returning string isn't allowed anymore with v28

https://jestjs.io/docs/upgrading-to-jest28#transformer

@jean-smaug jean-smaug changed the title [WIP]chore: bump jest to version 28 chore: bump jest to version 28 Aug 13, 2022
"babel-loader": "^8.2.3",
"babel-preset-react-app": "^10.0.1",
"chalk": "^4.1.2",
"chokidar": "^3.5.2",
"cross-env": "^7.0.3",
"flow-bin": "^0.116.0",
"html-entities": "^2.3.2",
"jest": "^27.4.3",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
Copy link
Author

Choose a reason for hiding this comment

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

Needs to installed separately from jest
https://jestjs.io/fr/docs/upgrading-to-jest28#jsdom

@shahmirn
Copy link

Jest 28 has "issues" with, at least, the uuid and nanoid packages, based on:

https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports

In my company's codebase, we ran into the same issue with the @hookform/resolvers package also

CRA / this PR would ideally handle this, and also expose some configuration to allow additional packages to be included in this "list"

@jean-smaug
Copy link
Author

Jest 28 has "issues" with, at least, the uuid and nanoid packages, based on:

https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports

In my company's codebase, we ran into the same issue with the @hookform/resolvers package also

CRA / this PR would ideally handle this, and also expose some configuration to allow additional packages to be included in this "list"

👋

The case that you describe can surely be solved by an overriding tool such as Craco.

IMHO it's not the responsibility of CRA to handle specific related to external packages. Because it's impossible to determine all packages that will need this specific config.
And adding this kind of feature, could be a first step in allowing CRA to be overridable, which is not something bad. But it's not something that I can decide.
At least, it should be mentioned in the documentation as a "known issue" 🤷‍♂️

@mrmckeb what do you think ?

@shahmirn
Copy link

I feel like nanoid and uuid should definitely be handled out of the box, as they're super-popular packages and a bunch of people will run into the issue.

For others, it may be worth exposing a new ENV variable that can be set, similar to others mentioned at

https://create-react-app.dev/docs/advanced-configuration

@jean-smaug
Copy link
Author

I feel like nanoid and uuid should definitely be handled out of the box, as they're super-popular packages and a bunch of people will run into the issue.

For others, it may be worth exposing a new ENV variable that can be set, similar to others mentioned at

https://create-react-app.dev/docs/advanced-configuration

Seems a good answer to your demand 🤷‍♂️
https://jestjs.io/docs/upgrading-to-jest29#jsdom-upgrade

I'll do the upgrade later, but this PR will finally be a bump to v29 of jest 😄

@lnhrdt
Copy link

lnhrdt commented Feb 11, 2023

Hey @iansu I did some digging and saw that you were the one that merged the PR the last time Jest was upgraded in CRA. Any chance you could help move this along and into a new release? Or can you suggest another way to proceed?

@arkosarkar343
Copy link

Can we please merge this PR? In my project there are 1244 tests and it takes around 20mins to run. Upgrading jest to 29 will help us use sharding and I am sure it will reduce significant amount of time.

@ghalestrilo
Copy link

Can we please merge this? Facing a similar situation to what @arkosarkar343 described

@gauravshah27
Copy link

gauravshah27 commented Apr 14, 2023

Can we get someone to merge this PR - we are facing memory issues on Node.js 16 and Node.js 18 and here are some of the issues that are we are seeing:

This is preventing us from using Node.js 16 and 18 and we have to keep using the Node.js 14 version which is end-of-life and thus increases the security risk.

Can any maintainer that has context on this PR comment and provide a timeline on when this is going to be merged ??

It would also be equally helpful to let us know if this is giong to move forward or no - given the direction that React is going in where they are recommending the use of Next.js / Remix for developing applications.

It would be great if we can get a release from CRA enabling jest 29 so that we can move to the latest LTS versions of Node.js without running into issues that we are seeing already in terms of memory usage of jest workers.

@wyardley
Copy link

Maybe see comments in
#13066
we are looking at moving to Vite in the short term, while exploring longer term options.

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.

Upgrade jest to v28 so that sharding is available.
8 participants