简体   繁体   中英

How to create only spec.ts file with Angular CLI?

我正在使用--spec=false创建Angular组件,但是现在我需要进行单元测试,有没有一种方法可以使用Angular CLI仅创建spec.ts files

According to this Feature Request , it has not been implemented at this time. I think you have to do it by hand for now.

Currently, Angular CLI does not provide this functionality. However, you can make a pull request to the @angular/cli team to integrate your idea, and if the code works and the idea seems good enough, they might add it.

Or, you can use SimonTest is an extension to VS Code that generates tests for existing files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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