-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
nx@6 ng test runs only first app #514
Comments
Really depends whether that's the new behavior that follows the official Angular CLI. Would be interesting to hear from the NRWL team what they think about it. Anyways, you could wire it up yourself as I did, something like (it's cumbersome, though):
Moreover generally speaking I guess it's preferred to use the
yep, notice such strange behavior as well. |
I just checked and this behaviour is coming from the Angular CLI. At least I am able to reproduce the same issue there. |
@DenisVuyka Yes, guessed so. However it would be nice to have a global test script that collects all test cases. don't have the time right now, but in theory one could configure an app that points a karma and Also from a TDD perspective. Like if I'm working on a feature which spans across some app & libs, I'd like to run all test cases to immediately see whether I'm breaking something. |
+1, very important feature. What is the position of the Angular team about this? |
You can change the tests to not watch by default via the angular json config. That will make it so that it goes one after another; it won't aggregate all tests across projects and run them together. Not ideal, but can work for the time being. |
This is the change in the Angular CLI 6. With Nx, you can restore the old behavior. You can test one project, like this:
You can test all projects using
Ideally, though, you would only retest the things that were affected by your change:
And you can also do it in parallel:
You are also in the process of adding
|
Has anyone had any luck with this in regards to multiple |
I just used one karma conf file for not watching and another for watching. then for each app I have an npm script called "test-app1", "test-app2", "live-app1", "live-app2"... the build server calls a script called "test_all" that runs "npm run all test-*". this works well enough. The live scripts all reference the same karma file so I did not need to create one for each app. the test_all takes forever though because it starts a new process after each app and library. of which I have 12. |
The latest version if NX should allow doing this by using the affected:test script and appending |
@jasedwards That's not ideal for a project with 10+ libraries--for me, it'd be like 30 lines extra for tests. |
@Nxt3 agreed. I am hoping this is a temporary workaround |
Just for documentation and confirming with @juristr this now works with |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
After upgrade, when running the "npm test" or "ng test", only tests for the first application are executed. And it runs in the watch mode.
Moreover, if I shut down the process, the second project test run is performed, and so for each project in the workspace I have.
Expected behaviour: it should run all tests as it did before the upgrade
The text was updated successfully, but these errors were encountered: