x)- [ ] bug report -> please search issues before submitting
- [x] feature request
@angular/cli: 1.1.1
node: 7.10.0
os: darwin x64
@angular/animations: 4.2.2
@angular/common: 4.2.2
@angular/compiler: 4.2.2
@angular/core: 4.2.2
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.2.2
@angular/http: 4.2.2
@angular/material: 2.0.0-beta.6
@angular/platform-browser: 4.2.2
@angular/platform-browser-dynamic: 4.2.2
@angular/router: 4.2.2
@angular/cli: 1.1.1
@angular/compiler-cli: 4.2.2
@angular/language-service: 4.2.2
ng g c componentName
(no logs)
Instead of generating a test that only passes:
it('should be created', () => {
expect(component).toBeTruthy();
});
We could write a test that indicates is pending. Something like so:
it('pending...should be created', () => {
expect(component).toBeTruthy();
pending();
});
or just add a new spec, like so:
it('pending...write tests', () => {
pending();
});
More about the pending method: https://jasmine.github.io/2.0/introduction.html#section-Pending_Specs
My suggestion is to avoid cases when the developer uses the generator from angular-cli, but doesn't re-write the test when it should.
I'm curious what others have to say, this is interesting. I was not aware of the pending function.
馃憤 I quite like this as the tests generated by the CLI, while they will pass, aren't really testing anything.
Marking them as pending() or xit by default lets developers know that they haven't actually implemented tests for the generated items yet.
It's possible to fork the existing schematics and customize them according to your use case. Let us keep this outside the scope of the CLI for now.
Please feel free to open a new issue in case I'm missing something.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
馃憤 I quite like this as the tests generated by the CLI, while they will pass, aren't really testing anything.
Marking them as
pending()orxitby default lets developers know that they haven't actually implemented tests for the generated items yet.