This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23459|Reply: 2

[Angular] Angular 6 prohibits the generation of *.spec.ts files

[Copy link]
Posted on 10/17/2018 11:29:49 AM | | | |
spec.ts files Sometimes, we don't need them at all, so I want to ban the generation of spec.ts files, is there a solution?

Method 1:

You can also disable spec generation when creating content with Angular-cli by adding "--no-spec"






Method 2:

Permanently disabled in angular.json files. You can edit the schematics node.









Previous:AngularCLI command cheat table
Next:Angular6 project uses scss
 Landlord| Posted on 5/4/2020 10:55:44 AM |
angular 9 does not create spec.ts test files

 Landlord| Posted on 5/15/2024 5:01:23 PM |
Angular 17 skips generating the "spec.ts" file with the following command:


--skip-tests:Do not generate "spec.ts" test files for the new project.Aliases: -S

"schematics": {
        "@schematics/angular:class": {
          "skipTests": true
        },
        "@schematics/angular:component": {
          "skipTests": true,
          "standalone": false
        },
        "@schematics/angular:directive": {
          "skipTests": true,
          "standalone": false
        },
        "@schematics/angular:guard": {
          "skipTests": true
        },
        "@schematics/angular:interceptor": {
          "skipTests": true
        },
        "@schematics/angular:pipe": {
          "skipTests": true,
          "standalone": false
        },
        "@schematics/angular:resolver": {
          "skipTests": true
        },
        "@schematics/angular:service": {
          "skipTests": true
        }
      }


Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com