Angular 6 + CLI (TypeScript) - How to stop generating .spec.ts test files

后端 未结 11 861
一向
一向 2020-12-13 05:52

I know it\'s kind of a bad practice, but bear with me:

I\'m using Angular-CLI, particularly ng g to generate all of my classes. However

11条回答
  •  有刺的猬
    2020-12-13 06:18

    Just to update Sabbir Rahman's answer:

    In version 1.0.2 of the CLI you will have to set the spec file to false for each individual type. An example is included below:

    "defaults": {
        "styleExt": "scss",
        "component": {
          "spec": false
        },
        "service": {
          "spec": false
        },
        "directive": {
          "spec": false
        },
        "class": {
          "spec": false // Set to false by default
        },
        "module": {
          "spec": false // Set to false by default
        },
        "pipe": {
          "spec": false
        }
      }
    

提交回复
热议问题