问题
I have a multi app project. I can run the apps separately with the following command: ng serve --app <appName> -aot
.
In the other hand I would like to be able to run the test for each app separately the same as running them.
e.g. ng test --app <appName> --sm=false
But it's doesn't work as expected. The test started always by the first app in the file system.
I have been searching and found out that I might have to change to configuration of the angular-cli.json
- Proposal: app-specific karma config which make sense... but unfortunately it didn't work also.
Any hint please?
回答1:
You don't need the --app
parameter. Instead run ng test <appName>
.
If you check ng test --help
you get: usage: ng test <project> [options]
I am on Angular CLI: 6.0.0-rc.6
, though.
来源:https://stackoverflow.com/questions/47330580/how-to-test-apps-separately-in-a-multi-app-project