Generating Component without spec.ts file in Angular 2+

前端 未结 25 1067
轮回少年
轮回少年 2021-02-01 00:48

Is there a way to get rid of the spec.ts file in Angular 2+, whenever I create a new component. I know this is for testing purpose but what if I don\'t need it.

May be t

25条回答
  •  一个人的身影
    2021-02-01 00:58

    For angular 6+ Simply run this command:

    ng config schematics.@schematics/angular.component.spec false
    

    OR

    just add this in your angular.json file and you're good to go

      "schematics": {
        "@schematics/angular": {
          "component": {
            "spec": false
          }
        }
      }
    

    NOTE: before pasting this check for conflicts, hope it helps

提交回复
热议问题