Angular CLI为现有组件创建.spec文件 [英] Angular CLI create .spec files for already existing components
问题描述
.angular-cli.json
中有一个选项可以禁用自动创建*.spec
文件的功能,例如有关组件,请参见
There is an option in .angular-cli.json
to disable the automatic creating of *.spec
files e.g. for components, see json schema.
这是一个非常好的功能,因为个人(这只是我的观点)在快速发展的项目中测试组件可能并不是真正值得的.
This is a really nice feature because personally (this is just my opinion) testing the components might not be the thing that really worth it in a fast growing project.
但是有时候我想有一个选项来为已经存在的组件/服务/管道/任何东西生成/重新创建相应的*.spec
文件.
However sometimes I would like to have an option to generate / recreate the corresponding *.spec
file for an already existing component / service / pipe / whatsoever.
使用某些命令行调用可以吗?
Is that possible using some command line call?
创建了功能请求,让我们看看它的运行方式...
Created a feature request, let's see how it goes...
推荐答案
当前Angular CLI不提供此功能,目前尚不清楚如何以及何时以正式方式进行管理.
Currently Angular CLI does not provide this functionality and it is not clear how and when it will be possible to manage it in official way.
但是,这是一个库"ngx-spec",它基于Angular CLI规范预设来生成规范.
这篇关于Angular CLI为现有组件创建.spec文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!