Closed AllanOricil closed 1 year ago
using Node 16.10 reduced the amount of memory usage, but It was still not enough to let my tests run on a vm with 4gb of ram. I had to alocate 8gb just for running unit tests, which is extremelly overkill and expensive.
Thanks for letting us know! Based on the 200+ comments in the Jest bug (https://github.com/facebook/jest/issues/11956), this is affecting more than just sfdx-lwc-jest
. Based on my cursory reading of the issue, downgrading to Node 16.10 seems like the prudent option until this is figured out.
Ah, I misread your comment. Supporting Jest 29 would be possible, but may cause compatibility issues, so it would have to be done carefully.
Because this would introduce breaking changes, and Jest is provided by this package, I believe this is the time for creating v2 in order to support Jest 29. Then you can deprecate v1.
So you already tried to upgrade Jest to v29 https://github.com/salesforce/sfdx-lwc-jest/releases/tag/v1.1.3
But it was removed in v1.1.4
It is better if you maintain one major version for each jest major version instead of releasing patches, because sfdx-lwc-jest is usually added to sfdx projects using ~/^ (i believe sfdx cli is adding it with ^). If u release a "patch" that changes a "major" version of jest, people's tests will certainly break.
Please, try again but release as v2.
Description
I'm running Jest tests in my ci pipelines, and it started failing because it is consuming too much heap memory. You can learn more about it in this github issue https://github.com/facebook/jest/issues/11956
I have already tried lots of different things and none worked. I would like to try setting
workerIdleMemoryLimit
but it is only available in Jest 29. I can't use this setting with Jest v27 or v28, as shown in the image belowConfiguring Jest with the following additional flags could solve my problem: