I am running this command:
C:\Users\Murali\my-first-app>ng g c abcde5 --dry-run -t -s --spec=false
I am receiving the following error:
Unknown option: '--spec'
How can I correct my command to avoid this?
Run ng config schematics. @schematics/angular. component. spec false to configure spec for components.
spec. ts file. This file contains unit tests for the main AppComponent. When running tests using the Angular CLI, all unit tests in files with the *.
You have to use "--skip-tests true" when generating component. (Note: you can get the above version info by trying "ng v" or "ng -v" in the terminal). You can get the complete list of switches for "ng g c (short for ng generate component)" using "ng g c --help". Alternatively you can add a component manually.
module. ts (3181 bytes) NOTE: The "dryRun" flag means no changes were made. As you can see I've ran a command which generates a new component.
You can find all options here. Answering you question replace --spec=false
by --skip-tests
. If it won't working please provide the AngularCLI version
You can also use --skip-tests
flag to skip generating .spec files.
For more detail, you can use ng g c --help
, this will give you further details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With