-
Notifications
You must be signed in to change notification settings - Fork 306
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
[Bug]: Upgrading jest-preset-angular to 11.* makes it unusable #1311
Comments
This is odd, we don’t change anything about compilation except using a note is that, upgrading deps will cause old Jest cache to be invalid so the next run Jest will need to cache again everything. |
@ahnpnl no change for me with this pr, also please validate the code, imo it never gets inside condition. |
More details about our issue, it's about js files processing, more specifically about Now imagine you have 5 workers, every single js file from lodash-es is being processed 5 times by jest-preset-angular then 5 times by ts-jest. This makes process way longer. |
Thanks for the information, it makes sense to me. Would you please use https://github.com/thymikee/jest-preset-angular/tree/main/examples to make a reproduce case? |
@ahnpnl Here's the repository: And I think I found true problem: ==== original ng-jest-transformer With cache: ==== configSet cached With cache: === configSet cached, without parsing js files with esbuild With cache: So esbuild makes everything faster so the condition should stay as it was.
fixes the issue |
the fix looks a bit similar to #1309 indeed. Feel free to open a PR :) |
I just updated all my angular packages from 12.2.3 to 12.2.13. When I ran test I got this
Then I updated jest-preset-angular to latest and it didn't fix it. |
Version
11.1.0
Steps to reproduce
We have quite large app, after upgrading to 11.1.0 our tests increased by 2x in time only with jest-preset-angular upgrade.
I suspect that using lodash-es, lodash-decorators-esm, date-fns, @UPPY makes it longer with the latest version. I already tried several approaches:
The result is almost always the same, run time increased 2x on ci environments but even worse on my local machine. With v10 warmup took more or less 15-20 seconds, with v11 warmup takes more than 140 - 200 seconds.
At this point using library v11 is complete blocker and blocks us from upgrading to angular 13.
Expected behavior
Performance should stay as it was in v10
Actual behavior
v11 increases built time more than 2x.
Additional context
Our tests with
Test Suites: 1 skipped, 349 passed, 349 of 350 total
Tests: 3 skipped, 1247 passed, 1250 total
v10.1 with clean cache:
Time: 181.311 s
With cache:
Time: 84.668 s
v11.1.0
Time: 421.699 s
With cache:
Time: 132.581 s
Environment
System: MacOS 12.1 Binaries: Node 14.15.3 NPM 6.14.9 Packages: Jest: 27.4.7 @ngneat/spectator 7.2.0 Angular 12.2.14 && Angular 13
The text was updated successfully, but these errors were encountered: