如何在多应用项目中单独测试应用? [英] How to test apps separately in a multi-app project?

查看:31
本文介绍了如何在多应用项目中单独测试应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多应用项目.我可以使用以下命令单独运行应用程序:ng serve --app -aot.

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 --sm=false 但它没有按预期工作.测试总是由文件系统中的第一个应用开始.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆