You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been developing a handful of in-house component and service libs, and these snippets have saved me a lot of time the last couple of weeks. So thank you!
The angular CLI has generated spec files for all types of angular entities since day one, and we're quite happy that version 6+ supports library generation out of the box. But the structure that the CLI scaffolds is oftentimes a bit too rigid for our use cases. We tend to follow the folder and file structure of the wonderful @angular/material2 library. So we usually write spec files ourselves.
Another motivation or spec snippets would be that sometimes components and directives have to work together to achieve a certain behaviour (i.e. an autocomplete component where there is an input, a trigger, an option container and some options). This is usually tested inside a test host component. While this might technically be classified as an integration test, we still tend to write these sort of tests in a spec file in the containing folder (autocomplete.integration.spec.ts).
A final motivation is that, while scarce, I assume there are still projects out there that do not depend on the CLI whatsoever, and do not reap the benefits of the CLI's spec scaffolding.
I've been working on this yesterday and have a few spec snippets done (component, service, pipe, directive). I'd be more than willing to submit a PR for those. Or I can finish snippets for interceptors, guards etc, but maybe that could be a follow-up PR?
I'm tagging you in this issue @wardbell, as @johnpapa mentioned you were also interested in/working on spec snippets. What do you think of this suggestion?
Regards,
Wouter Spaak
The text was updated successfully, but these errors were encountered:
We've been developing a handful of in-house component and service libs, and these snippets have saved me a lot of time the last couple of weeks. So thank you!
The angular CLI has generated spec files for all types of angular entities since day one, and we're quite happy that version 6+ supports library generation out of the box. But the structure that the CLI scaffolds is oftentimes a bit too rigid for our use cases. We tend to follow the folder and file structure of the wonderful @angular/material2 library. So we usually write spec files ourselves.
Another motivation or spec snippets would be that sometimes components and directives have to work together to achieve a certain behaviour (i.e. an autocomplete component where there is an input, a trigger, an option container and some options). This is usually tested inside a test host component. While this might technically be classified as an integration test, we still tend to write these sort of tests in a spec file in the containing folder (autocomplete.integration.spec.ts).
A final motivation is that, while scarce, I assume there are still projects out there that do not depend on the CLI whatsoever, and do not reap the benefits of the CLI's spec scaffolding.
I've been working on this yesterday and have a few spec snippets done (component, service, pipe, directive). I'd be more than willing to submit a PR for those. Or I can finish snippets for interceptors, guards etc, but maybe that could be a follow-up PR?
I'm tagging you in this issue @wardbell, as @johnpapa mentioned you were also interested in/working on spec snippets. What do you think of this suggestion?
Regards,
Wouter Spaak
The text was updated successfully, but these errors were encountered: