ng test does not run tests for all projects
See original GitHub issue🐞 Bug report
Command (mark with an x
)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Don’t know
Description
The ng test
documentation states “When a project name is not supplied, it will execute for all projects”. However, this does not appear to be true. Only the tests for a single project are run.
🔬 Minimal Reproduction
- Clone https://github.com/swseverance/my-workspace
- npm install
- Run
ng test
and observe how only the tests for the app are run. The tests for the lib are not run.
OR
- Create a workspace
- Create an app within the workspace
- Create a lib within the workspace
- Run
ng test
and observe how only the tests for the app are run. The tests for the lib are not run.
🔥 Exception or Error
N/A
🌍 Your Environment
Angular CLI: 11.2.14
Node: 14.17.0
OS: darwin x64
Angular: 11.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.14
@angular-devkit/build-angular 0.1102.14
@angular-devkit/core 11.2.14
@angular-devkit/schematics 11.2.14
@schematics/angular 11.2.14
@schematics/update 0.1102.14
ng-packagr 11.2.4
rxjs 6.6.7
typescript 4.1.6
Anything else relevant?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ng 10: how to run tests for all projects
according to the docs of ng test, ng test (without any project) should run all tests: When a project name is not supplied,...
Read more >ng test
Option Description Value Type Defau...
‑‑browsers Override which browsers tests are run against. string
‑‑code‑coverage Output a code coverage report. boolean false
‑‑code‑coverage‑exclude Globs to exclude...
Read more >Angular CLI: “ng test” with Jest in 3 minutes (v2)
I'm not going to explain why you should choose Jest over Karma, assuming you already ... After you've done that ng test will...
Read more >Executing Unit Tests Using the Angular CLI
You learned that you can use the ng test command to execute all of your unit tests via the Jasmine testing framework while...
Read more >Run tests | IntelliJ IDEA Documentation
If your tests don't require any specific actions before start and you ... Place the caret at the test class to run all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So what is the solution to run all tests in monorepo?
I stand to correct myself. The test command runs only the default project tests when a project is not provided and watch true by default. All tests are run when no project is provided and watch is false which we found useful for CI. Sorry for the confusion.