angular-cli: ng new my-project --skip-tests shouldn't generate karma/protractor files
The --skip-tests
flag for ng new
didn’t quite match my expectations as a developer.
Versions
Angular CLI: 1.6.0-beta.0
Node: 8.4.0
OS: linux x64
Angular:
...
Repro steps
ng new my-project --skip-tests
Observed behavior
create my-project/.angular-cli.json (1528 bytes)
create my-project/.editorconfig (245 bytes)
create my-project/.gitignore (516 bytes)
create my-project/src/assets/.gitkeep (0 bytes)
create my-project/src/environments/environment.prod.ts (51 bytes)
create my-project/src/environments/environment.ts (387 bytes)
create my-project/src/favicon.ico (5430 bytes)
create my-project/src/index.html (296 bytes)
create my-project/src/main.ts (370 bytes)
create my-project/src/polyfills.ts (2667 bytes)
create my-project/src/styles.css (80 bytes)
create my-project/src/test.ts (1085 bytes)
create my-project/src/tsconfig.app.json (211 bytes)
create my-project/src/tsconfig.spec.json (304 bytes)
create my-project/src/typings.d.ts (104 bytes)
create my-project/e2e/app.e2e-spec.ts (292 bytes)
create my-project/e2e/app.po.ts (208 bytes)
create my-project/e2e/tsconfig.e2e.json (235 bytes)
create my-project/karma.conf.js (923 bytes)
create my-project/package.json (1322 bytes)
create my-project/protractor.conf.js (722 bytes)
create my-project/tsconfig.json (363 bytes)
create my-project/tslint.json (2985 bytes)
create my-project/src/app/app.module.ts (316 bytes)
create my-project/src/app/app.component.css (0 bytes)
create my-project/src/app/app.component.html (1120 bytes)
create my-project/src/app/app.component.ts (207 bytes)
Desired behavior
create my-project/.angular-cli.json (1528 bytes)
create my-project/.editorconfig (245 bytes)
create my-project/.gitignore (516 bytes)
create my-project/src/assets/.gitkeep (0 bytes)
create my-project/src/environments/environment.prod.ts (51 bytes)
create my-project/src/environments/environment.ts (387 bytes)
create my-project/src/favicon.ico (5430 bytes)
create my-project/src/index.html (296 bytes)
create my-project/src/main.ts (370 bytes)
create my-project/src/polyfills.ts (2667 bytes)
create my-project/src/styles.css (80 bytes)
create my-project/src/tsconfig.app.json (211 bytes)
create my-project/src/typings.d.ts (104 bytes)
create my-project/package.json (1322 bytes)
create my-project/tsconfig.json (363 bytes)
create my-project/tslint.json (2985 bytes)
create my-project/src/app/app.module.ts (316 bytes)
create my-project/src/app/app.component.css (0 bytes)
create my-project/src/app/app.component.html (1120 bytes)
create my-project/src/app/app.component.ts (207 bytes)
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 50
- Comments: 28
Completely agree with this. In my mind, Skipping tests removes anything to do with testing. Karma, E2E, spec files and configs (inside angular-cli.json), etc…
On the other hand, I also find it ridiculous the only option is to use
-minimal
which removes tslint/linting.See my comment above. The issue is the
--minimal
flag removes linting in addition to removing the testing frameworks. I think this would be fine, as that seems pretty minimal, however the flag’s description only says it removes test frameworks and doesn’t mention linting:To make things more flexible, there should probably be a
--linting
flagIn CLI
v7.0.4
the--minimal
flag is already working as expected. No generated test files. 👌For anyone wanting to create an Angular project without test packages, files and configurations, I’ll leave my conclusions: Using @angular/cli@10.2 Create a project using
--skip-tests
. Remove the following:e2e
folderkarma.conf.js
angular.json
: thetest
ande2e
configuration sections.src/test.ts
npm uninstall @types/jasmine, @types/jasminewd2, jasmine-core, jasmine-spec-reporter, karma, karma-chrome-launcher, karma-coverage-istanbul-reporter, karma-jasmine, karma-jasmine-html-reporter, protractor
@Dewberrycat,
Can you elaborate on what’s the not correct in the docs about the skip test option?
In https://angular.io/cli/new the description of
-skip-tests
states the clearly what it does;May I also remind you to keep the conversation constructive per the code of conduct. Thanks
@ErroneousFatality / @Dewberrycat this is an OSS project, feel free to create a PR to improve the docs if you find some parts are out of dated or incorrect. Such contributions would be greatly appreciated.
It removes the test files, but also removes linting so it isn’t really the right solution. The issue still remains that
--skip-tests
should remove ALL testing frameworks, not just unit testsStill an issue in 6.2.2
Tested with CLI 6.0.3. Testing setup is still being generated when using
--skip-tests
flag.Would be really nice to have this feature covered in the next releases.
Tested on release and beta versions, still having this problem.
ok, --skip-tests also still doesnt work, what is wrong with angular team? do they remember where angular.io is? why they dont care about people, should we all be Nostradamuses to guess what to do?
You have to Use –skipTests
--minimal
also forces the templates and styles to be inlineIt still here
why in angular.io is written --skip-tests and they didnt fix to --skipTests. they dont care?
Roger!
ng new my-project-no-test --minimal=true --routing=true --skip-tests=true see https://angular.io/cli/new
Also,
--minimal
with--inlineTemplate
and--inlineStyle
set to false is not working.Angular CLI 6.0.7 still the same.