-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component generation without spec file? #1256
Comments
I think this is especially relevant for projects that follow the "smart component vs visual component" pattern. The purely visual components in such a design usually should not have anything in them worthy of a test. |
Maybe an api like:
|
to generate a component without a "...spec.ts" file you simply run "--spec false". Example below ng g c testfile --spec false |
Hi there!! If you don't want to generate spec file, just make default property value to false.. |
Hello, @duncanhunter i am advancing you to create the component manually, mostly when we use cli we don't know what is the use of the generated files. and in case if you want to generate the component with cli without spec you can use this |
you can use -S with command to skip the test files |
Option "spec" is deprecated: Use "skipTests" instead. |
Option "spec" is deprecated: Use "skipTests" instead. Example: |
application
component
Angular 2:
"defaults": {
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
} |
for consistency {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
...
"projects": {
"your-app": {
...
"schematics": {
"@schematics/angular:component": {
"inlineStyle": false,
"spec": false
}
},
....
} |
@mmmichl Working Solution! |
ng generate directive "directiveName" --skipTests |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Frequently we make components with no logic that we do not wish to write unit tests for. We would like to use the CLI to generate components with no spec file.
The text was updated successfully, but these errors were encountered: