-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
run ngcc when using ng test to run test with ivy #679
Comments
ngcc
when using ng test
to run test with ivy
I agree, this should be a part of the builder. Thanks for the investigation. Would you like to make a PR? |
Let me give it a try. I'm currently struggling with finding out how the angular team runs ngcc before they run karma. I'm completely new to that code so I need some time there. |
Also, I wonder, maybe for the sake of compatibility we should first look for the flag in |
In my opinion, we should just check for the flag in |
Here are my findings:
Conclusion: |
So, the only way, for now, is the running ngcc manually before running the tests (in postinstall, for example)? But this is a problem for our CI to execute ngcc for packages of the whole monorepo on every test run because of our CI workers install all packages from zero every time and ngcc in additional takes as much as 10 minutes in each build. |
Unfortunately, currently this is the only way. A few things you can do: |
Describe the solution you'd like
When running
ng test
withinside
angular.json
, it should runngcc
beforehand asangular-cli
already does (see: angular/angular-cli#15044 (comment)). Otherwise, tests are not running withivy
, which should be the default for angular 9.As this might break existing tests, an
options
flag like"enableIvy": false
could still be added in order to run them the old way. Or just use the configuration that's already existing intsconfig.spec.ts
which usually points totsconfig.ts
that has"enableIvy": false
already defined.Describe alternatives you've considered
The only way I could make it work is by defining a
scripts
insidepackage.json
.and then execute it with
npm run test
.It would still be great to just run it with
ng test
The text was updated successfully, but these errors were encountered: