简体   繁体   English

如何从子目录在 Angular CLI 项目中运行测试?

[英]How to run tests in an Angular CLI project from a subdirectory?

I have an Angular CLI project, which is a large single-page app.我有一个 Angular CLI 项目,它是一个大型单页应用程序。 This app is divided into multiple feature modules that are lazily loaded.此应用程序分为多个延迟加载的功能模块。

What I'd like to be able to do is to go into the subdirectory of one of my modules and run just the tests for that module.我希望能够做的是进入我的一个模块的子目录并只运行该模块的测试。 The idea is to have our CI server be able to detect which module(s) have changed and only run the tests for those module(s).这个想法是让我们的 CI 服务器能够检测哪些模块发生了变化,并且只运行这些模块的测试。

Is there a way to do this?有没有办法做到这一点? I tried running ng test from within the module subdirectory, but that didn't seem to do it.我尝试从模块子目录中运行ng test ,但这似乎没有做到。 Hopefully there is a way to do this.希望有办法做到这一点。

对此的快速解决方法可能是将所有测试从它(到xit(这会将它们从测试中排除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM