-
Notifications
You must be signed in to change notification settings - Fork 12k
Can't run 'ng test' on all apps in a project and provide overrides #10765
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
Comments
|
Just to make sure I'm understanding you--I can't run |
Couldn't (Like WebStorm 2018.2 EAP still fails to run tests, due to the above error, where as the current 2018.1.3 throws "Error: The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to be used from within Angular CLI and will not work correctly outside of it." due to #10703.) @Nxt3 I'm not sure if this is what you're asking, but for me, with 3 projects in (But trying something like |
@clydin have you tested that with latest versions of angular/cli? because i have a multiproject workspace and for me it seems like in this case command line arguments are not properly propagated thorugh cli.
This line isn't working at all for me, although it would indeed be how i expected it to work. In my case the tests of the given project ([project_name]) are properly executed but all the additional parameters are ignored and the defaults are used instead. Thanks for letting me know if it works for someone in a multiproject workspace. |
Is there a way to disable that? I am overriding the |
Normally "me too" comments aren't real helpful, I'll try for an exception: I'm seeing this same problem using the beta of @angular/cli 7.0.0, so it hasn't been accidentally fixed:
The problem is exactly as described - I have a pretty spare multi-project workspace, most of the projects haven't been updated much after they were generated from the cli. And, Workarounds appear to be:
|
This should be documented and isn't. |
Any progress on this? Running tests on all projects seems to be a nice feature. |
Had this issue upgrading to v7 and i'vent seen anyone talking about this... In my case i kept the default name (dev), so i did:
|
Hello guys, can someone help me understand why angular/cli when running ng test is opening and compiling files for each project indywidual ??? This proces cause a lot of time that is redundant. In my project when I move karma.conf.js, test.ts and tsconfig.spec.json to root level. If someone needs to run all test for all projects (CI for example). I really encourage you to try this approach. |
@Tomek6789 can you describe the changes required? |
@mihalcan You need to create test.ts file that will gather all the test.
When running test you can provide your entry-point file (test.ts) with main flag. Please remember to add also your new test.file in tsconfig.spec.json in files prop. |
On a new project that was using the versions below:
I ran these commands:
The
I'm pretty sure this was still broken in earlier 7.x versions, but it seems to be fixed in that one. |
Why each project in angular.json is opening browser for running tests? This is important whan you want to reduce test time execution. |
@Tomek6789 it looks like you can achieve that behaviour when using |
@v-erena Nope that won't work. I want to run all tests from all projects on one browser and compile them onec. If you run So ng test will run command from angular.json .projects["projectName"].architect.test with options provided. But this is probably feature for angular.cli |
One of the reasons why I switched to Jest (besides Jest has a nice CLI and doesn't require you to change source files to only execute selected tests). |
if you have multiple apps than you can mention its name in the command as below. yarn test web --code-coverage here web is app in angular project. |
We also wanted to execute all test of all our projects at once in one browser. Starting and stopping the browser for each library was incredibly time-consuming. Our solution was to create a dummy project inside the You can see what we did in my commit here: joostme/ng-test-all@6e4a00a |
@joostme This is a great workaround for now, thanks! Hopefully Angular CLI fixes this issue soon though so we won't need to do all this to make it work, but I appreciate you sharing this, was a huge lifesaver for us. |
@joostme This is the work around I needed and the one that works best from everything I've read. Thanks my dude. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
ng test --watch=false
or anything that would provide an overrideObserved behavior
ng test
works as long as I don't provide overrides.Before
@angular/cli@6.0.0
, runningng test --watch=false
would work. Now you get the following error:Desired behavior
I should be able to provide overrides on
ng test
regardless of the number of projects I'm running it on. This worked prior to@angular/cli@6.0.0
.The text was updated successfully, but these errors were encountered: