简体   繁体   English

如何在Angular-CLI中测试命令?

[英]How to test commands in Angular-CLI?

I'm trying to create my own small project, which will represent a CLI with basic number of my own commands. 我正在尝试创建自己的小型项目,该项目将代表具有基本命令数量的CLI。 This project is based on Angular-CLI. 该项目基于Angular-CLI。

And my question is: how can I test my own commands? 我的问题是:如何测试自己的命令? Or how can I test Angular-CLI commands, first of all? 还是首先要如何测试Angular-CLI命令?

My idea was to copy e2e and serve commands, after that pack all my new commands to e2e runner and then test it... But I'm not really sure about this way. 我的想法是复制e2e并提供命令,然后将所有新命令打包到e2e运行程序中,然后对其进行测试……但是我不确定这种方式。

Couldn't you please help me? 你能帮我吗?

Thank you! 谢谢!

you can create your own scripts in package.json--> scripts folder. 您可以在package.json--> scripts folder.创建自己的脚本package.json--> scripts folder.

Example :- 例子:-

 "port4900": "ng serve --port 4900",

npm run port4900 if you execute this command it will your app on 4900 port insted of default 4200 npm run port4900如果执行此命令,它将在默认设置为4200的4900端口上安装您的应用

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

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