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
When using angular-cli there is a bunch of options to pass. To generate a new component without tests, you can simply add --spec=false
like so:
ng generate component --spec=false my-component
There is also an option in the angular-cli.json for which types you want to enable specs by default, where you can modify the behaviour:
"defaults": {
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}