Skip to content
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

Feature request/suggestion: add snippets for specs #88

Open
WouterSpaak opened this issue Jun 14, 2018 · 2 comments
Open

Feature request/suggestion: add snippets for specs #88

WouterSpaak opened this issue Jun 14, 2018 · 2 comments

Comments

@WouterSpaak
Copy link

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

@johnpapa
Copy link
Owner

thanks for the idea. Yes, please submit some. We'll need to update the changelog, readme, and the code in the PR.

Perhaps start with a small set so we can work out the kinks. The ones you are most comfortable with

@johnpapa
Copy link
Owner

good idea. anyone want to make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants