You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a real issue on some of our older computers, taking upwards of 30 minutes to try to run some very (at this stage) simple specs.
I appreciate @Coly010 in issue 13983 you mention that this is a jest-preset-angular issue. However, NX pushes you into using Jest for testing Angular, I was looking at switching back to Karma, which I prefer in some ways, but NX seem to have deprecated that. While it seems I could manually configure it, this creates a lot of work for the team moving forward as the generators will not generate karma config for new apps or libs.
If NX is positioned to be an alternative to Angular CLI, I feel the test defaults it chooses should not come out of the box with memory leaks.
It takes a while to notice the memory leak as NX does such a good job of not re-running specs, as our project is also new it takes a few months before you start noticing this.
I will open an issue on jest-preset-angular, maybe you can help me push the issue forward there.
Maybe you can re-instate Karma as a first class NX citizen? That would also solve my issue
Thanks for all your work on NX it's generally really great!
Expected Behavior
Tests should not leak memory and complete in a reasonable time-frame.
I do understand that it's frustrating that there is a memory leak here, but as mentioned in the previous issue it is out of our control.
We will not be re-instating Karma. You can create a local Nx Plugin with a generator that will set this up for your projects which should reduce the work involved.
Also, Angular themselves will be moving away from Karma in the near future, preferring both Jest and Web Test Runner.
We've got improvements to our Jest solution in the pipeline and should be worked on in the coming months. We're also evaluating if we want to add support for Web Test Runner.
As this is correctly raised as an issue on jest-preset-angular, I'm going to close this issue.
Current Behavior
Similar to this issue which is closed, memory seems to be leaking when using Jest to test our app.
#13983
I have a sample NX app and a sample Angular CLI app, based on the samples in that issue
https://github.com/vespertilian/nx-jest-test-app
https://github.com/vespertilian/jest-preset-angular-mem-usage
It's a real issue on some of our older computers, taking upwards of 30 minutes to try to run some very (at this stage) simple specs.
I appreciate @Coly010 in issue 13983 you mention that this is a
jest-preset-angular
issue. However, NX pushes you into using Jest for testing Angular, I was looking at switching back to Karma, which I prefer in some ways, but NX seem to have deprecated that. While it seems I could manually configure it, this creates a lot of work for the team moving forward as the generators will not generate karma config for new apps or libs.If NX is positioned to be an alternative to Angular CLI, I feel the test defaults it chooses should not come out of the box with memory leaks.
It takes a while to notice the memory leak as NX does such a good job of not re-running specs, as our project is also new it takes a few months before you start noticing this.
I will open an issue on
jest-preset-angular
, maybe you can help me push the issue forward there.Maybe you can re-instate Karma as a first class NX citizen? That would also solve my issue
Thanks for all your work on NX it's generally really great!
Expected Behavior
Tests should not leak memory and complete in a reasonable time-frame.
GitHub Repo
https://github.com/vespertilian/nx-jest-test-app
Steps to Reproduce
npm install
npm run test
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: