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
Just adding this bit of information because I found myself struggling with the same issue and could not fix it by using the current answer(s), plus I did not want to make the changes on the angular-cli.json
file. It appears the recent version of Angular CLI --spec=false
is depreciated and therefore no longer works, use --skipTests
instead.
Test on:
Angular CLI: 9.1.1
Node: 12.16.1
OS: win32 x64
Your command with then be:
ng g c mycomponent --skipTests
instead of
ng g c mycomponent --spec=false
PS: Always test your commands using the --dry-run
option to test your output.