Is there a way to get rid of the spec.ts file in Angularjs 2, whenever I create a new component. I know this is for testing purpose but what if I don't need it.
May be there is some setting to disable this specific testing file.
Is there a way to get rid of the spec.ts file in Angularjs 2, whenever I create a new component. I know this is for testing purpose but what if I don't need it.
May be there is some setting to disable this specific testing file.
simply try this one. this is working
ng g c "componentName" --spec=false
Updated for angular 8 CLI
Inside your
angular-cli.json
set the spec.component parameter tofalse
:or use the
--spec=false
option during creationThere is a command for disabling Angular generate "spec" files by default
UPDATE: For Angular 6
ng config schematics.@schematics/angular.component.spec false
Use also the following command if you want to skip your spec.ts file:
ng g c try-it --skipTests=true
where
g c
=> generate component ,try-it
=> component name ,--skipTest=true
=> ==-- spec false
.here what it is for angular 9
it will not generate spec.ts files.