如何在多应用项目中单独测试应用? [英] How to test apps separately in a multi-app project?
问题描述
我有一个多应用项目.我可以使用以下命令单独运行应用程序:ng serve --app
.
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.
例如ng test --app
但它没有按预期工作.测试总是由文件系统中的第一个应用开始.
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.
我一直在搜索并发现我可能需要更改 angular-cli.json
的配置 - 提案:特定于应用程序的业力配置 有意义...但不幸的是它也不起作用.
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.
有什么提示吗?
推荐答案
您不需要 --app
参数.而是运行 ng test
.
You don't need the --app
parameter. Instead run ng test <appName>
.
如果你检查 ng test --help
你会得到: usage: ng test
If you check ng test --help
you get: usage: ng test <project> [options]
不过,我使用的是 Angular CLI:6.0.0-rc.6
.
这篇关于如何在多应用项目中单独测试应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!